I want to iterate over a string that contains accountIds, that is pulled from a "Request Participants" field. Use those values to then update a custom field (multiuserpicker) with those same account ids.
I recommend not using a branch to solve this scenario...
Branches which could be on more than one thing run in parallel and asynchronously, with no guarantee of the processing order or when the branch will complete...up until the last step of the rule: https://support.atlassian.com/cloud-automation/docs/jira-automation-branches/#Ordering-of-branch-executions
Thus for your scenario, the different calls to Edit Issue could collide, leading to rule errors or the edits "walking over" each other and not saving as expected.
Instead, try to iterate over the values to build dynamic JSON and the use one single Edit Issue action with the JSON. Please update the custom field id values in the expression below to match your fields.
{{#if(exists(issue.customfield_10027.accountId))}}
{
"update" : {
"customfield_10964" : [
{{#issue.customfield_10027.accountId}}
{ "add": { "accountId": "{{.}}" } } {{^last}}, {{/}}
{{/}}
]
}
}
{{/}}
Kind regards,
Bill
Hello @Ricardo Gonzalez
Are you trying to create an Automation Rule for this? If so, please show us what you have so far.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
the "test" field returns a string that contains two accountIDs split by a comma.
I then want to use that list/string to iterate over (which is the addCustom).
I would like to update my custom field with those values. But I am not following how to iterate over the string and to update and insert an accountID for every value of that string
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for that additional information.
Please show the details of the Branch step.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, thank you, that was what I was requesting.
To iterate over a list of comma separated values you need to use the split function:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.