Automation For Jira - Writing a rule that automatically closes issues that have been in the same status for X days
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
The purpose of this article is to explain how to configure an automation rule that will automatically close (or transition) issues that have been in the same status for at least X days.
One use case for which this rule can be useful is the case where you have a Service Management project where tickets have been waiting on the customer side for many days. For this type of ticket, you might want to either automatically transition the ticket to a "First reminder" status or close the ticket (depending on your workflow).
Environment
- Jira Server/Data Center on any version from 8.0.0 (Or Jira Service Management from 4.0.0)
- Automation For Jira on any version from 7.4.0
Solution
Automation Rule configuration
The rule can be configured as described below, but please feel free to adjust it (especially JQL query) so that it can fit your requirements:
- Add a Scheduled trigger with the settings below:
- Frequency: once per day
- When rule executes: "
JQL query:
The JQL query below will search for issues from the project SDBASIC that have been in the status "Waiting for customer" for at least 5 days (you might need to change the project name, status, and number of days)project = SDBASIC AND status = "Waiting for customer" AND NOT status CHANGED AFTER -5d
- Add the Transition Issue action
- For this action, you can either choose the transition or the destination status of your choice (for example: Closed status, Resolved status, "First reminder" status...)
Automation Rule screenshot
The described above will look like this: