Forums

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

Automation For Each Append Value to the Field

Kevin Lioenel July 26, 2023

Hi Team, need help

So right now I'm running For Each Smart Value to get data from API and expect it to run Synchronous
So I can append the Fields from the value of that For Each

But when I'm trying it running Parallel/Asynchronous for every looping each

So the value I expect is

Loop 1 value: 123, 122, 121
Loop 2 value: 223, 222, 221
Append Field: 123, 122, 121, 223, 222, 221

But the reality said
Append Field: 223, 222, 221

When I monitor the field, the automation firstly edits the field into 123,122,121 then was replace it into 223,222,221

When replacing the Field i was using "Set Issue Field" and set the value:
{{issue.Project Key Id}} {{webResponse.body.data.id}}

please help how i can make it?


Rule I'm using


Screenshot 2023-07-27 at 10.13.24.png

1 answer

0 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.
August 1, 2023

Hi @Kevin Lioenel 

Branches that could be on more than one thing run asynchronously and in parallel, so you cannot append values in a loop in this way.  In fact, there is no guarantee that such branches will complete up to the last step in the rule...so you cannot use actions/impacts inside the branch loops for steps after the branch.  (I recall there is an open suggestion to add a "wait until done" to branches, like for web requests.)

For branches on one-and-only-one-thing, the "trick" of updating created variables only works because the branch gets run in-line.

So, a couple of possible work-arounds...

How many {{directorateName}} loops are you doing: a fixed number or an indeterminate number?  If a fixed number, you might be able to skip the branch (loop) and run one long rule.  If indeterminate that will not work.

Without seeing your entire rule, I am guessing a bit on the next part: have you considered some divide-and-conquer to process in separate rules, and then use some flagging operation in a final rule to accumulate the results?

Kind regards,
Bill

Suggest an answer

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

Atlassian Community Events