Automation rule to count how many times an issue has passed through a specific status
Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.
Summary
For reporting purposes, admins sometimes want to know how often an issue has been through one specific status. If the issue has a long lifecycle, this information is hard to find from the issue history. In such cases, this article aims to provide an easier way to track this information using custom fields and automation rules.
Solution
The below steps have to be followed to create the custom field and the automation rule; we are going to use the Reopened status as an example:
- Create a custom field of Number type.
- Create a Jira automation rule as below:
- Trigger: Issue Transitioned > Select the desired status.
- Action: Edit issue > Choose the field created in step 1 and the below smart value to add 1 to the field count.
{{#=}}{{issue.Number field}} + 1{{/}}
- Trigger: Issue Transitioned > Select the desired status.
- Once the issue is transitioned from another status to Reopened, the custom field will be updated with +1.
Extra Notes
The drawback of this approach is that you need to set a different rule and custom field for every status you want to count and it counts toward your automation usage limits: