Jira Automation: Wait for IF/ELSE to run before continuing rest of flow?

Paulo Sebastião July 19, 2024

Hi team,

I'm having a problem which after some googling and some chatGPT I still can't seem to have a clear answer upon. 

It seems like there's no sequential guarantee that things will run in order once you have an if/else component in a JIRA automation. Is that correct? See the example below:

Untitled 2.png

Even the "swimlanes" seem to indicate that the start of an IF/ELSE is a fork from the main path and that the main will continue to execute. Is there a way to bring it back to the path? Like, execute everything first in the if/else and only then continue to run the rest of the block?

4 answers

2 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 19, 2024

Hi @Paulo Sebastião -- Welcome to the Atlassian Community!

What observations lead you to believe the if / else block is not running sequentially?

My understanding is if / else blocks process sequentially.  Based on the rule you show, perhaps one or more of those many Send Web Request actions have not selected the option to "Delay execution of subsequent rule actions..." and so they show in the log as having finished later.

Otherwise, I think only branches which could be on more-than-one-thing run in parallel / asynchronously.

 

The "swimlanes" you describe are just the recently updated rule editor design, indenting conditional and branching logic visually.

 

Kind regards,
Bill

Paulo Sebastião July 24, 2024

Hi @Bill Sheboy 

Nice to hear from you, who previously saved me in so many other situations when I read your replies to others :)

What is leading me to think is not running sequentially is that the log action don't show in correct order in the audit log? I.e. a log action after the branch can occur before all the other actions in the branch have ran - and yes, I've confirmed that the send web requests are "waiting" for the reply.

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 25, 2024

Paulo, to confirm the situation: is there a branch in your rule or do you mean the if / else block

  • If it is a branch, I would expect that behavior for branches which could be on more than one thing
  • If it is a single issue branch (e.g., Current Issue) nested within an if / else block, there is an open defect for the symptom of apparent step (or log entry) ordering: https://jira.atlassian.com/browse/AUTO-1092

Otherwise...I have observed cases where things in the audit log may appear out of order because they happen in very close time proximity.  I have not been able to consistently repro this or I would submit a defect.

2 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 19, 2024

Hello @Paulo Sebastião 

Welcome to the Atlassian community.

I have seen suggestions that you could separate the branch (If/Else) into a separate rule. And in the current rule use a Send Web Request action to call that separate rule rather than having the If/Else directly in this rule.

Paulo Sebastião July 24, 2024

This is actually a good practice, maybe only handle failure scenarios on the main rule itself, and then create other rules that are triggered either by calling them or by actions (created branch or pull request, for example) which are output of the main rule. I might look into this.

2 votes
Scott Schellhardt
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 19, 2024

Hi Paulo

I would break this into multiple rules and have the second rule running based on the conditions defined as part of the completion of the first rule. So basically, from compare two values down, I would make into a separate rule. 

There maybe someone here that has more experience with this type of automation, and can give a better answer but i hope this helps.

0 votes
Jesse Kona
Contributor
February 12, 2025

I add an action "Re-fetch issue data". 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events