Escalation Service

Before you start

View our training module on ScriptRunner for Jira Cloud Automation Capabilities.


What is the Escalation Service?

The Escalation Service allows you to define a process for modifying issues after a certain amount of time has elapsed. This is useful for business procedures that require tasks to be completed within a certain time-frame (service level agreement).

How to use Escalation Services

Escalation Services can be used if, for example, a task has been opened but not assigned for 7 days. You could automatically move it to a "Prioritize" status, or add a comment which will cause an email to be sent.

The minimum interval between code executions is 1 hour. The scheduler is triggered every hour and gathers all the tasks to be executed within that hour. The task executions are queued and workers will consume them in no predefined order. That means that the execution time of the task can not be guaranteed to be the same every hour. As an example: if you configure a job to be run every hour, it might be run at 01:02 and then 02:24 and then 03:00 and then at 04:46 etc depending on how busy our systems are

Create an Escalation Service

  1. Navigate to ScriptRunner → Escalation Service.
    Depending on whether or not you have already created escalation services, you are presented with either a landing screen or a list of previously created escalation services.
  2. Click Create Escalation Service from the initial landing screen if none have been previously created.

    OR
  3. Click Create Escalation Service from the previously created list.  
  4. (Optional) Click Edit or Delete for your chosen escalation service via the Actions ellipsis on this page to modify or delete as required.
    You will see the Create Escalation Service screen, as shown below: 
  5. Enter a name in the The Escalation Service called field. NOTE: The With Identifier field shows the unique identification key for the new escalation service.
  6. Activate the Enable Escalation Service toggle. When set to Enabled, the new escalation service is active as soon as it has been saved.
  7. Click on the edit pencil within the On this schedule field.
    • The Scheduler dialog lets you choose between running your script on several days during the week (e.g. Monday, Wednesday, Friday), or running your script on particular days of the month (e.g. the last day of the month, the 2nd Tuesday of the month).
    • You can enable a monthly schedule.
    • Additionally, you can select an hour interval during which time your script will run.
    • Each service can execute for the same length of time as Script Listeners, Post Functions and in the Script Console as documented in the script limitations.
  8. Enter a JQL query, for example, status = 'In progress'. Each defined job must have a JQL query that will be run in order to find the issues you wish to modify. 
  9. Enter the name of the user you wish to run the service for in As This User.

  10. Write your script in the Code to Run field. The code you provide as part of the job configuration will be run against each issue individually and in parallel. Each issue will be injected into your code as part of the Script Context.
    OR
    Alternatively, you can click the Example scripts button to view a list of example scripts related to this feature.

    So, rather than writing your own script, you can reuse one of the many examples provided, as follows:
    1. Choose an example script from the list provided and the code automatically appears. You also have the option to search for a particular script.
    2. Click Copy Code and then Close.
    3. Paste the copied code in the code editor.
  11. Click Save or Run Now. The results of the run and logs are displayed per each issue.

Maximum Issues

The maximum number of issues you can modify in any execution of an Escalation Service job is 50. In other words, we limit the number of issues returned by each JQL query to 50 issues.

Edit an Escalation Service

  1. Navigate to ScriptRunner → Escalation Service. A list of all escalation services is shown.

  2. Click Edit on the Actions ellipsis of the escalation service you wish to edit.
    You will see the Edit Escalation Service screen, as shown below:

  3. Edit the fields as required. When all changes have been made, click Save. You can also click Revert to undo those changes.

  4. Click Run Now after all changes are complete.
On this page