customfield_10193
{{issue.customfield_10193.split(",")}}
customfield_10164
Island,TEST,Test_Gilad,TestIt
TEST
TestIt
Island
Test_Gilad
Hi @Bar Azgad -- Welcome to the Atlassian Community!
Automation rule branches which could be on more-than-one-thing are executed in parallel and asynchronously. There is no guaranteed order of processing or even when the branch will complete, up until the last step of the entire rule.
What this means for the rule you show is the updates are colliding / walking over each other during the update processing, leading to unpredictable results.
The solution for your scenario is to add all of the labels with a single update using dynamically created JSON and a list iterator:
Your branch logic seems to only be checking if the new label is not present before attempting the edit. If that is ignored, the values could be updated even if they exist with this:
{ "update": { "labels": [ {{#issue.customfield_10193.split(",")}} { "add": "{{.}}" } {{^last}},{{/}} {{/}} ] }}
If you only want to perform the edit if the values are not currently present as labels, that would require using a dynamic regular expression and the removeAll() function to first eliminate any existing values.
Kind regards,Bill
Thank you!
Hi Bill,
Thank you for the detailed explanation and resources! Do you have additional recommendations or resources to learn more about Jira automation capabilities, especially for creating advanced rules like this one?
Kind regards,Bar
Awesome; I am glad to learn that helped!
For learning more about automation rules, I recommend experimenting, reading, and collaborating...
@Bill Sheboy Although this is more of an old thread, What if you are trying to populate labels in a for each branch that are coming from a web request inside the for each? i am trying to "fetch" the account id into a label field, but usually 2 out of 3 are added, i understand the multithreading here, so would you recommend doing this on another way?
It looks like you're new here. Sign in or register to get started.