I created a new user lookup field called 'Code Reviewer'. I also have a workflow status called 'Code Review'.
If the 'Code Reviewer' field is not empty, I want to require the ticket to go to the 'Code Review' status before the status gets set to closed.
If the 'Code Reviewer' field is empty, I don't want to require the ticket to go to the 'Code Review' status. It can go straight to closed.
How do I do this with workflow automation or global automation rules?
Hey I think you can try with 2 diff ways:
1. Use Workflow Conditions
Jira workflows let you control which transitions are available based on field values. In your case, you want to prevent tickets from moving directly to “Closed” if the “Code Reviewer” field is filled out, unless they’ve gone through “Code Review.”
Here’s a way to do it:
Edit your workflow (Project settings → Workflows).
Find the transition that goes to “Closed.”
Add a Condition to this transition:
If your Jira supports “Value Field” conditions (like in Jira Cloud or with certain workflow apps), set it so that the transition to “Closed” is only available if either:
The “Code Reviewer” field is empty, or
The current status is “Code Review” (i.e., the issue has passed through that status).
If you can’t do this natively, you might need a marketplace app like
Jira Misc Workflow Extensions (JMWE) | Atlassian Marketplace or ScriptRunner for Jira | Atlassian Marketplace to add more advanced workflow conditions.
2. Using Automation Rules
If you prefer automation, you can set up a rule to catch when someone tries to close a ticket:
Go to Project settings → Automation.
Create a rule:
Trigger: Issue transitioned to “Closed”
Condition: If “Code Reviewer” is not empty and the previous status was not “Code Review”
Action: Reopen the issue, add a comment, or send a notification explaining that code review is required.
This doesn’t block the transition, but it can “bounce” the issue back and let the user know what’s missing.
Thanks so much! I was able to get this figured out now using the automation rules. Unfortunately, our Jira version seems to have some limitations with the workflow conditions so I wasn't able to figure it out using those.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks so much! I was able to get this figured out now using the automation rules. Unfortunately, our Jira version seems to have some limitations with the workflow conditions so I wasn't able to figure it out using those.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.