Forums

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

Automation using branching troubles

Jared G
Contributor
September 12, 2024

I have an automation with the following goal/setup:

1. When we indicate "Yes" on a Billable Field (custom field), for any ticket, a new ticket is created.
2. The new ticket is linked to the trigger ticket
3. On the new ticket, fields are copied from the trigger ticket
4. One of those fields is the second trigger "Client". IF = "Non Client" - assign a particular person (on the new, secondary ticket) and move the workflow.

5. If the trigger is anything OTHER than non-client, then it assigns someone else, and moves to a different stage of the workflow.

My results have been mixed, but typically its creating the ticket fine, linking the issue fine, and then it tends to follow the second branch, not the first, regardless of the parameters I set.

Said another way: Looking at the automation screenshots I'm only getting one result, it doesn't seem to recognize the secondary triggers and apply the correct path. 

1.png2.png3.png

1 answer

1 accepted

2 votes
Answer accepted
Trudy Claspill
Community Champion
September 12, 2024

Hello @Jared G 

Branches are not an either/or construct. All branches in a rule will execute.

You can put a condition in the branch to determine if it should continue executing, if the steps in the branch apply only under specific circumstances. You have such a condition in your first branch, but not in your second branch. So your second branch will always execute all its steps. You need to add a condition to it if you want it to execute only under specific conditions.

 

Additionally be advised that branches execute in parallel, not sequentially. Refer to 

https://confluence.atlassian.com/jirakb/in-the-automation-parallel-execution-of-the-branches-to-main-thread-can-produce-incorrect-unexpected-outcome-1115147731.html

Because of that parallel execution for branches you might want to instead separate those steps out to another rule trigger by Issue Created, where you add a condition to check if the newly created issue meets conditions that tell you it was created through the first rule. In that second branch you could then use and IF-ELSE construct to say:

If "Client" = "Non-client"
--- execute some steps

ELSE
--- execute other steps

https://support.atlassian.com/cloud-automation/docs/jira-automation-conditions/#If-else-block

Jared G
Contributor
September 16, 2024

Thanks Trudy.  I ended up breaking up the automation and it's working cleanly now.  I appreciate your input.  

Like Trudy Claspill likes this

Suggest an answer

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

Atlassian Community Events