I use Jira Cloud and set up an automation to transition a task when all its subtasks are transitioned. It works, but if for example a task has 10 subtasks, and I transition all of them together, the automation triggers and transitions the parent task 10 times. Is there some way to prevent all these duplicate transitions? Screenshots of the automation and duplicate transitions in the task history are below. Thanks.
Hi @M K
Yes, and...to the suggestions from @Marc -Devoteam-
This is definitely a racetrack timing situation, and may require different approaches to solve, depending upon your Jira license level:
When you have Premium or Enterprise Cloud, the Delay() action is available and could be added after the rule starts to pause the action for several seconds.
Without those license levels, and even with them occasionally, you may need some rule restructuring to help. For example, you could explicitly check sibling subtasks before proceeding:
parent = {{triggerIssue.parent.key}}
AND status != "{{triggerIssue.status.name}}"
AND issueType = Sub-task
This approach focuses on first slowing down a bit with a re-fetch on the trigger work item, and then explicitly checking the sibling sub-tasks...which will take a bit more time. Then, only proceed if we are on the last one, whereby the condition passes.
Even with this approach, it could still fail to work correctly...particularly when Atlassian is in the midst of an automation outage, slow down, etc. One belt-and-suspenders approach would be using two rules:
Kind regards,
Bill
Thanks, I'll start with trying the first solution and seeing if it helps. It's fine if it still occasionally duplicates the transition, it doesn't cause any real harm, I'm just looking to reduce the status history pollution for most cases.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunately, the first solution doesn't appear to help. It's either still too fast or the delay is too uniform to prevent the race condition.
That said, clearly the second solution would work, if I decide that the longer delay is worth the clean history. It's just a shame there's no other viable option on a standard license.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @M K
I don't know a way to limit this by a setting.
What if you add a delay action in the rule within the branch?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I can try that, but how do I add a delay? I don't see an action for that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That will mean you are on standard.
The Delay action is used to pause rule execution (for example to avoid parallel updates), but it’s only available on Premium/Enterprise plans
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @M K
Your rule is almost correct, but the duplicates come from parallel executions when multiple subtasks transition at the same time. Each execution checks the parent before it has been updated by the others, so they all try to transition it.
One important improvement: instead of using “Copy from trigger work item”, try setting a fixed target status (e.g. “Ready for Testing”) and add a condition like:
parent status ≠ “Ready for Testing” or something like that.
This makes the rule idempotent and prevents repeated same-to-same transitions.
You can also keep the Re-fetch issue data step to improve consistency, but the key change is avoiding the dynamic “copy status” action.
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.