I'm working on a Jira Automation rule to automatically update a User Picker (multi-user) field based on the results of linked Assets objects.
I have an Assets field on my issue called Location (customfield_10871). It's a multi-object field — meaning multiple Assets (Locations) can be selected.
customfield_10871
Each Location object contains a user attribute (Approver) that links to one or more Jira users — these are the people I want to add to a Jira user picker field (customfield_10896, for example, called “FSQA Managers”).
Approver
customfield_10896
The rule uses a “For each object” branch to iterate over each Location in the issue's Assets field.
Inside the branch:
I run a lookupObjects action to get the matching record from Assets (e.g., objectType = "FSQA Managers" AND Name = "{{locations}}")
objectType = "FSQA Managers" AND Name = "{{locations}}"
I create a variable (e.g., FSQAmanagers) and append the users returned from lookupObjects.Approver.accountId
FSQAmanagers
lookupObjects.Approver.accountId
I use an Edit issue action with JSON that splits the variable and tries to add each user to the multi-user field
Edit issue
add
The variable I build (FSQAmanagers) contains multiple users — confirmed via logging.
However, only one user gets added to the field per rule execution.
If I manually re-trigger the rule, it adds another user from the same list.
My JSON uses split(",") with a loop to add each accountId, and I’m using the correct update structure — but still, only one user is added per run.
split(",")
update
I believe the issue is caused by scoping or execution order within the branch:
Each iteration of the “for each object” branch seems to create its own variable version
The edit issue action inside the branch may be firing before the variable is fully built, or it’s only seeing part of the data
edit issue
Because Jira doesn’t allow variables created in a branch to be used outside of it, I can't do the update after the loop finishes
Is there a way to reliably accumulate users from multiple Assets objects inside a branch, and then add them all at once to a multi-user field?
Is it possible to restructure this rule without using variables, perhaps by updating the field directly from lookupObjects inside each branch iteration?
lookupObjects
Is the observed behavior — only one user added per execution — expected with variables inside branches?
This updates each approver field:
{"fields": {"customfield_10896": {{issue.customfield_10929."FSQA Approver".flatten.asJsonObjectArray("id")}},"customfield_10897": {{issue.customfield_10929."Location Approver".flatten.asJsonObjectArray("id")}}}}
This updates the participants:
{"fields": {"customfield_10032": [{{#allParticipants.split(",").distinct}}{"id": "{{.}}"}{{^last}},{{/last}}{{/allParticipants.split(",").distinct}}]}}
HI @Kurtis
Could you if you provide:
1. images that show your complete rule.
2. images showing the details of any relevant actions/conditions/branches.
3. images showing the Audit Log details for the rule execution.
These questions are not for not willing to help, but to have community members understand on how automation works.
Here are screenshots showing the automation, the JSON, and the log.
I have been hammering at this for a while now, so I don't really know what revision of the JSON I'm on and how far off or close it is to the actual solution.
Done - Thank you
Hi @Kurtis
You could try the following, in the edit action:
{ "update": { "customfield_10896": [ {{FSQAmanagers.flatten.asJsonObjectArray("id")}} ] }}
I got this info from KB; https://support.atlassian.com/jira/kb/how-to-auto-populate-approvers-from-asset-objects-attributes-using-automation-in-assets/
Thank you, but this was unsuccessful. Please see the error in the log screenshot.
It looks like you're new here. Sign in or register to get started.