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.
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”).
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}}"
)
I create a variable (e.g., FSQAmanagers
) and append the users returned from 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
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.
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
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?
Is the observed behavior — only one user added per execution — expected with variables inside branches?
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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/
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.