Restrict Transition Options for Issues in On Hold and Pending with Requester Status
Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.
Summary
In Jira, there is no native feature that restricts issue transitions to only allow moving back to the previous status. Users often require this functionality to maintain control over the issue lifecycle. Although Jira does not support this feature directly, it can be achieved using the 'Automation for Jira'. This enables the creation of custom rules for automating various tasks, including restricting transitions based on the issue's previous status.
Solution
To implement restricted transitions in Jira using Automation for Jira, follow these steps:
Create a Custom Field:
- Add a custom field named
PreviousState
to your Jira issues. This field will store the issue's previous status.
- Add a custom field named
Set Up an Automation Rule:
- Create a new Automation rule that triggers when an issue transitions to specific statuses (e.g., "On Hold" or "Pending with Requester").
Update the
PreviousState
Field:- In the Automation rule, include an action to update the
PreviousState
field with the issue's current status before the transition occurs. This action ensures that the previous status is recorded.
- In the Automation rule, include an action to update the
Add a Condition to Each Transition:
- For each transition coming from statuses like "On Hold" or "Pending with Requester", add a condition to check if the
PreviousState
field matches the intended previous status (e.g., 'On Hold'). The comparison should be done as a string. - Only allow the transition if the condition is met, i.e., if the issue's current status matches the value stored in the
PreviousState
field.
- For each transition coming from statuses like "On Hold" or "Pending with Requester", add a condition to check if the
Set the Value of
PreviousState
Field:- After the transition occurs, ensure that the
PreviousState
field is updated to reflect the new current status of the issue.
- After the transition occurs, ensure that the
By following these steps, you can effectively restrict transitions in Jira to only allow moving an issue back to its previous status, using the capabilities provided by Automation for Jira.