I'm having an issue using using the for branch that stems from it not functioning as a loop, but rather trying to action everything at once.
I have an automation that uses a for branch to look at all linked issues, and then pull a specific field from linked issues and write them to a filed on the trigger issue, with values being separated by commas. The field would already have a value in it, so the additional values would be added with the initial value. My initial idea to do this was to create a for branch that looked at each linked issue, get the field value, and then write to the trigger issue field taking the initial value and appending on the comma and new values. If the for branch functioned as a loop, this would work. However, I found out it does not loop through the actions, and instead tries to action each element at once. The results was the values not writing properly. Below is the issue history when I ran this (The original value is 109, and I want to 187 and 269):
My next idea to fix this is to instead write this to a label field, instead of a text field. Label fields have an "add" function, so I thought it wouldn't matter that multiple values would be added at the same time. However, I found that this still had issues. In this example, I want to add labels 269, 114, 187, and 268 to a custom label field that starts empty.
It appears that the "Add New" function does something similar to what I was doing in the previous example, where it looks at what the current labels added are and copies them into it and adds the new one. It still has the problem of when multiple adds are being done at the same time, it does not capture all of them.
I am wondering if there is a better way to achieve what I am looking to do. If there was a way to make the for branch function as a loop, this would solve my problem. Other creative ideas are most welcome.
Thanks!
Christian
Hi @Christian
For a question like this, please post an image of your complete automation rule, images of any relevant actions / conditions / branches, an image of the audit log details showing the rule execution, and explain what is not working as expected. Those will provide context for the community to offer ideas. Thanks!
Until we see those...
Automation rule branches which could be on more than one thing are run in parallel and asynchronously. In fact, there is no guarantee of when the branch will complete up until the last step of the rule.
For your scenario, each update of the trigger issue is walking over (or colliding with) other updates.
One possible solution for your specific scenario would be:
For example to concatenate a single text field from the issues, the expression could be this:
{{lookupIssues.myCustomField.join(", ")}}
Seeing your rule and knowing more about your custom field will help clarify the solution approach.
Kind regards,
Bill
It seems concurrently updating those fields is a source of problems.
Instead, maybe you could "pre-calculate" the string you are looking for and store that in smart value using the "Create variable" action. And at the end of the execution write the smart value to the field.
If "Create value" has a better concurrency control, then it may work...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.