Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

If/Then not available in sub-tasks?

MJCorcoran
Contributor
July 18, 2023

I have an automation (below) and I would like to use if/then statements to have a different action/sub-task created depending on the value of an issue field (Middle Name). I cannot get it to run at all if the 1st If statement (that it's not "Enter Middle Name" or "NA") fails. Normally, I would use an If/Then/Else block, but it seems that I'm using some kind of limited automation rule where the options for branching are limited, or am I missing something obvious?

Jira Pic.PNG

2 answers

1 accepted

3 votes
Answer accepted
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 18, 2023

Hi @MJCorcoran 

You appear to be branching on current issue; that is not needed if your intent is only to work with the current issue (i.e., trigger issue in your case).

After you remove that branch, you may use the if/else conditions as they will not be under a branch.

Kind regards,
Bill

MJCorcoran
Contributor
July 20, 2023

I actually double-branched and it work great. I tried using a variable, but it didn't work well.

Capture22.PNG

Like Bill Sheboy likes this
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 20, 2023

Well done!  And an FYI...

When using branches in automation rules, scope is important...particularly with issues and created variables.

Specifically: branches on one-and-only-one issue get run in-line (e.g., branch on current issue, branch on parent, etc.), as if the branch was not there.  All other branches run in-parallel and asynchronously.  And there is no guarantee when such branches will complete...right up to the last step of the rule.

The impact of this is if you create a variable inside of a branch, the value is usually not available outside of the branch.  (This is because the variable is re-created and goes out of scope with each loop.)

So, for the first case (i.e., one-and-only-one issue branches) created variables can be preserved using a "trick"/feature of such branches:

  • action: create a variable, with the name varMyVariable
  • branch: on current issue
    • some actions...
    • action: create a variable, with the same name varMyVariable
    • ...
  • outside of the branch, the variable has the updated value AND still exists
0 votes
Mohanraj Thangamuthu
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 18, 2023

Hi, could you try automation shown on the image below.

Screenshot 2023-07-19 at 11.19.46 AM.png

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events