Automate issue escalation with ScriptRunner Escalation Services. Use a JQL query to modify issues based on elapsed time, and enable actions (such as transitions) to occur after a specified time has passed. For example, if a task has been opened but not assigned for seven days, you can set up an escalation service to automatically give the issue a priority status, or send an email to notify the team.

  1. From ScriptRunner, navigate to the Escalation Services tab and click Create Escalation Service→Escalation Service.

  2. In Description enter a description for the service, for example, Escalate to urgent.

  3. In JQL Query, enter a query to select the issues you wish to escalate. For example, issues in a specific project that have the status To Do but have not been updated for over five days.

    escalation service JQLquery
    This field issues a warning if the JQL query is incorrect. Test the query in the Issue Navigator first. For more information on JQL queries see Advanced Searching.
  4. Under As User, enter the user the service will run as. If the service is set to leave a comment, send an email, or transition an issue, it does so under this username.

    This user must have the correct permissions to execute the action (for example, transition the issue).
    Create a user called Automation (or similar) and give it administrator rights in every project. Then use this as the service user.
  5. In the Interval/CRON Expression field, enter how often the service should run. The interval can be in minutes, entered as an integer, or a CRON expression (recommended). The example shown runs every day at 6 am.

    escalation service CRON
    Due to the Atlassian scheduler, services set to run at a CRON or minute interval runs automatically upon start-up of Jira. To avoid this, use non-interval CRON expressions specifying the time the service should run (as seen in the example above).
    For more information on CRON expressions see Constructing CRON Expressions for a Filter Subscription.
  6. In the Action field, select a preset Jira or workflow action to occur at the time interval if the JQL query = true. This field is optional if Additional Issue Actions are specified.

  7. Add custom actions into the Additional Issue Actions script field to run additional code as part of the escalation, such as, add a comment to the issue, or set a custom field. Click Script to write directly into the console, or click File to select a script file from your script roots.

    escalation service additionalissueactions
    Select Show Examples to see examples of commonly used scripts.
  8. Under Transition Options optionally select which options the transition should skip:

    • Skip Permissions: Skip any permissions issues which may stop the issue transitioning.

    • Skip Validators: Do not validate fields during an issue transition.

    • Skip Conditions: Ignore all conditions on an issue, allowing transition despite the conditions not being met.

  9. Click Add to save the escalation service; the script will run on the interval specified. Optionally, click Run Now to run the script on the Jira instance instantly.

    Clicking Run Now does not save the escalation service. 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.