Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×Hello,
It seems that due to limitations in how automation handles variables and the inability to manage dual branching (such as combining relation + if/else), I struggled to implement what should have been a relatively simple automation.
Background
The initial design was to have a manual rule that would create several tasks from an epic and then link them together. This worked well as a single-threaded automation, using a variable to store the previously created KEY_ID and then utilizing that {{key_id}} in the linked issue block.
Things became more complicated when the team decided to utilize the 'input' feature for manual triggers, including checkboxes, as some tasks are optional. Since automation filters act as 'gates,' my script was interrupted whenever someone chose not to create a 'Design' (or any other) task.
To address this, I attempted to use branches with IF/else conditions, where I checked each user input and then proceeded with task creation (or skipped it). However, I encountered a problem with using Variables because they can't be passed from one branch to another or to the 'master' branch.
I decided to create custom fields to serve as persistent storage for issue IDs and then used {{smart.values}} during the linking stage. Unfortunately, this approach became messy and unreliable because all branches execute in parallel rather than in sequence, as the UI might suggest. As a result, sometimes a new issue was created faster than the previous task could store the value in the custom field, leading to failed links or even errors due to missing values.
Since there is no built-in delay function, I tried strategically placing re-fetches without success. I also added dummy actions and filters to slow down some branches so they would execute only after the previous step was completed and the data had populated into 'storage'. Yet, the results remained unreliable.
Finally, I decided to create two separate automations:
And now I'm stuck even on this seemingly simple automation!
If I set the trigger issue as the Epic itself and then use the 'for children relation' branch, I'm unable to utilize IF-ELSE conditions to process each task one by one, check its presence, and then create a link.
If I set the trigger issue as one of the child tasks, it seems I can't retrieve a list of its siblings. Moreover, if I use the 'for parent' branch to go one level up, I can't then target the siblings.
I've tried using JQL filtering, such as:
summary ~ "[BE]" AND parent = "{{triggerIssue.key}}" (or triggerIssue.parent.key for case then i attempted to use a simple task as trigger)
In the preview, this returns '1' result, but when I run the rule, it always finds nothing. Is this a bug?
Anyway, I'm open to more ideas!
It sounds like you encountered significant challenges due to the limitations of automation handling variables and branching logic, especially with the need to store and pass values between branches. The struggle with parallel execution and the inability to synchronize task creation with data storage is a common pain point when dealing with complex automation workflows. Your solution to split the process into two separate automations — one for task creation and another for linking — seems like a practical workaround, though it would be ideal if the system provided more robust handling of variables across branches. Hopefully, future updates can address these issues to make the process smoother. Thanks for sharing your detailed experience!
Hi @Alexey
Are all of the tasks created at one time in a single rule?
If so, you could still perform the linking in that rule using this approach:
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Hey @Bill Sheboy Thanks for help!
After brief test (with a single linking) i managed to get desired result! My assumption about 'variable belongs to the branch' was wrong! Due to parallelness my breakpoints were unable to catch the value, but your method with JQL 'stop' seems works.
So now I can create 5-6 issues for each work type via IFs based on user input, and then check each children with a JQL stopper and link them as team wanted.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Awesome; I am glad to learn that helped!
The "trick" to make variables retain values for conditions and single-issue branching is to define them before the condition / branch, and then replace (i.e., shadow) them inside. This method does not work for branches which could be on more-than-one-issue.
For example:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register Now
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.