Heads up! ScriptRunner for Bitbucket documentation has moved to https://docs.adaptavist.com/sr4bib. Adaptavist will keep this site up for a bit, but no future updates to documentation will be published here. ScriptRunner 6.20.0 will be the last release to link to scriptrunner.adaptavist.com for in-app help.

Create custom jobs to run actions at set intervals.

  1. From ScriptRunner, navigate to the Jobs tab.

  2. Select Add New Item, click Create Job, and then select Custom Scheduled Job.

  3. In Note, enter a description for the job.

  4. For User, enter the user the job will run as.

    This user must have the correct permissions to execute the action.
    Create a user called Automation (or similar) and give it administrator rights in every project. Then set Automation as the User when setting up a custom job.
  5. In the Interval/Cron Expression field, enter how often the job should run.

    The interval can be in minutes, entered as an integer, or a cron expression.

    The example shown runs every day at 6 am.

    escalation service CRON
    Jobs set to run at intervals run automatically upon start-up of Bitbucket. To avoid this, use non-interval cron expressions specifying the time the job should run (as seen in the example above).
    For more information on cron expressions, see Constructing Cron Expressions for a Filter Subscription.
  6. Add the job script to the Inline Script field.

  7. Click Add to save the job; the script will run on the interval specified. Optionally, click Run Now to run the script and see the results.

    Clicking Run Now does not save the job. Click Add to save.

Have questions? Visit the Atlassian Community to connect, share, and learn with other Atlassian users and experts, including Adaptavist staff.

Ask a question about ScriptRunner for JIRA, Bitbucket Server, or Confluence.

Want to learn more? Check out courses on Adaptavist Learn, an online platform to onboard and train new users for Atlassian solutions.