You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
I want to create an automation (for a company managed project) where story/bug issue type can transition from To Do state to In Progess only if 1. subtask approval is present AND 2. subtask approval is approved. If the sub-task approval is missing OR if it is not approved, I am thinking the 'In Progress' state will simply not be present in the state dropdown.
What you described is not an Automation but a Transition Condition in the Workflow, in this case in the workflow of the Story/Bug.
I can think about one way to do it out of the box even if maybe not the best.
What you can do is use the "Sub-Task Blocking Condition" where you can select the statuses you want the subtasks to be for the transition to be available to the user.
A pre-condition is that you should automatically create the Approval subtask when the Story/Bug is created, so you are sure it's always present, this won't work if the Approval subtask does not exist.
You should then define dedicated Statuses for the Approval Subtask (like "To be approved" and "Approved"), that you are not going to use in other Subtasks in the same project.
Now you can create the "Sub-Task Blocking Condition" and select all the statuses except "To be approved", in this way the transition will not be available only if the Approval Task is in that status.
Said this, I'm not sure if this is the best approach to managing approvals in a Software project, I would instead add an approval status in the Story/Bug workflow, maybe before "To Do" and limit the transition from that first status to "To Do" only to the specific people that should have the ability to approve it. You can do this based on a project role or a Jira group.
I hope this helps
Thank you for the response Giovanni.
So we do a have an automation now so that any time a story or bug issue is created, a sub-task approval is automatically created. The states used in sub-task are unique to sub-task.
My question for you is from where and how do I create a sub-task blocking condition?
This is company managed project so I cannot directly add conditions in the workflow (it is set to read only as many project used the same workflows). However, I can use automation for my project. I tried using following automation, but it still allows to change the parent story/bug status to In Progress, even is sub-task is not approved.
If you cannot change the Workflow you are not able to achieve what you have in mind. Because the workflow condition is the only way to block the transition, with Jira Automation you can only act after something happened.
You should ask your Jira Administrator to configure a dedicated workflow for your needs.
The only thing you can do with Automation is when someone transitions a Story/Bug to "In Progress" you can check if there is an approved Approval subtask and if it's not the case you can automatically transition the Story/Bug back to "To Do", maybe also adding a comment mentioning why it was moved back.
I hope this makes sense
Unfortunately, due to scale of JIRA we use at our organization getting this approval to allow changing workflow condition will likely not happen.
Your response on automation is helpful. Can you help me figure out how do I set the variable for this transition to happen. This would meet what I am trying to achieve.
Pls check the screenshot I shared before. That automation conditions are not doing what I wanted.
Hi @AT ,
This should work. You just need to match all the correct statuses.
In your case the JQL to be used in the "Related issue condition" is something like this:
issuetype = Approval AND status = "To be approved"
@Giovanni Melai Can you help with one more thing here.
Above you have helped me define that if a story/bug does not have an approval then automation moves it back to 'To Do' state. I want to add two more conditions:
1. If a story/bug DOES NOT have an approval sub-task, automation will move it back to previous state.
2. If a story/bug DOES NOT have an approved status on the approval sub-task, automation will move it back to previous state (Currently, it moves it back to To Do. Is it possible to simply move it back to last state story/bug was in - To, Researching, Ready, Blocked)
Hi @AT , sure.
1. for the first one, this was a bit tricky to find out because there are a few different cases to catch:
You can use an IF/ELSE condition configured in the following way:
In your case the JQLs will be something like:
status = "To Do" AND issuetype = Approval
issuetype != Approval
I tested it a bit and it seesm to work well.
2. for the second point to be able to go back to the previous status you can use smart values.
First you need to create a variable with the original status
Here the smart value to use for copy & paste:
Then you can use the variable in the transition Action like this: