Escalation Services
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.
Adding an escalation service
- From ScriptRunner, navigate to the Jobs tab and select Create Job > Escalation service.
- Enter a Name for the job, for example, Escalate to urgent.
Under User, enter the user the job will run as. If the job is set to leave a comment, send an email, or transition an issue, it does so as this user.
This user must have the correct permissions to execute the action (for example, transition the issue). The results of the JQL may differ depending on the permissions of the selected user.
Create a user called Automation (or similar) and give it administrator rights in every project. Then set Automation as the User when setting up an escalation service.
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.
Jobs set to run at intervals run automatically upon start-up of Jira. 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.
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.
Test the query in the Issue Navigator first. For more information on JQL queries, see Advanced Searching.
Select an action in the Action field. This field is optional if Additional issue actions are specified.
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.
Add custom actions into the Additional Issue Actions script field to run additional code as part of the escalation. For example, add a comment to the issue, or set a custom field.
Select Show snippets to see examples of commonly used scripts.
Select Add to save the escalation service; the script will run on the interval specified. Optionally, select Run now to run the script and view which issues were affected.
Selecting Run now does not save the escalation service. Select Add to save.