Hello community, greetings to everyone.
I wanted to share a case I’ve been working on and ask if anyone has successfully resolved something similar.
We were requested to implement an enhancement to a previous setup, where the technical challenge was to process an array obtained from a JQL query in a specific order. The solution had to adhere to the premise of minimizing the number of automation executions, avoiding the use of webhooks or unnecessary loops.
We tested two main approaches:
- Creating a branch with an ordered JQL query.
- Using a "For Each" loop to iterate over the array obtained from Lookup Issues.
Both alternatives encountered the same key issue: Jira Automation branches execute in parallel, resulting in random orders instead of maintaining the original sequence. Here are the details and results for each approach:
Alternative 1: Branch with JQL
- Trigger: Manual (for testing purposes).
- Branch: Executes a JQL query that returns issues in alphabetical order (e.g., ABC-1, ABC-2, ABC-3).
- Action: Log the keys (
{{issue.key}}).
Result:
Even though the JQL query returns an ordered array, the branch executes in parallel, resulting in random orders such as:
- ABC-3, ABC-1, ABC-2
- ABC-2, ABC-3, ABC-1
- ABC-1, ABC-3, ABC-2
Alternative 2: For Each with Lookup Issues
- Trigger: Manual (for testing purposes).
- Lookup Issues: Retrieves issues in alphabetical order (e.g., ABC-1, ABC-2, ABC-3).
- Branch: "For Each" loop over the keys (
{{lookupIssues.key}}), with a logging action.
Result:
Similar to the previous case, the branch executes in parallel, resulting in random orders such as:
- ABC-3, ABC-1, ABC-2
- ABC-2, ABC-3, ABC-1
- ABC-1, ABC-3, ABC-2
Conclusion:
We confirmed that Jira Automation branches execute in parallel, which makes it challenging to achieve the required serial order for this case.
Question for the community:
Do you know of any way to make a branch execute sequentially in Jira Automation? Or have you discovered creative solutions or alternatives to address similar needs?
Greetings, Mariano