Hey @Mathilde
Good question! In Jira Software there aren't approvals on status like in Jira Service Management, so we'll need to work out some other way of managing this.
We'll do this using custom fields and some transition conditions, and an automation if you wish!
Note: If you all of your statuses have "Any status can transition" you'll need to apply the condition I show for the below.
Sample Workflow:
Code Review -> Ready to Merge
Code Review -> Code Review (looping transition)
Part 1: Creating the Custom Fields
- Go to the cog at the top right, then Issues
- Create a custom field of type "Numeric" (this will be our approval counter)
- I'll call mine "Number of Approvals"
Part 2: Creating an approver group
- Go to your user management for your Organisation
- Create a new group for your approvers and add the desired people to this
Part 2: Configuring Transitions
- Go to edit your workflow through Project Settings > Workflows and edit the one you need
- On the transition between Code Review & Ready to Merge select that and click on Conditions
- Click on Add Condition and then choose "Value field"
- In here choose "Number of Approvals" and make the condition be >, the value should be 2 and the comparison type is Number
- Now, create a new transition from Code Review to itself and call it "Approved"
- On this transition, click on the Conditions part
- Click on Add Condition and then choose "User is in group", then choose the group you created earlier
- Click on Add Condition again, and then choose "Separation of Duties condition", then you're going to choose From status "Code Review" to status "Code Review"
- This prevents 1 person from approving twice on an issue
Part 3: Automations
- Create a new Automation where the trigger is "Issue transitioned" and specify FROM Code Review TO Code Review
- Now add the below actions:
- First action: Add a comment and input this: Reviewed and approved by {{initiator.displayName}}
- Second action: Edit issue and choose the field to be "Number of Approvals" and for the value put in: {{#increment}}{{issue.Number of Approvals}}{{/}}
- Optionally - if you want it to auto-transition after 2 approvals, to this same automation add the below:
- Re-fetch issue data
- Condition: Issue fields condition and choose Field as Number of Approvals condition greater than or equal to 2
- Transition issue and choose destination status as "Ready to merge"
Let me know if I can help further!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.