Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to update a multi-user field from multiple Assets in a branch using Jira Automation?

Kurtis
Contributor
May 13, 2025

What My Automation Is Trying to Do

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.

Context:

  • 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”).


What the Automation Does

  • 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


Problem I'm Running Into

  • 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.


What I Suspect (but need help confirming)

  • 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


What I Need Help With

  1. 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?

  2. Is it possible to restructure this rule without using variables, perhaps by updating the field directly from lookupObjects inside each branch iteration?

  3. Is the observed behavior — only one user added per execution — expected with variables inside branches?

 

2 answers

0 votes
Kurtis
Contributor
May 14, 2025

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. 

 

Screenshot 2025-05-14 071619.pngScreenshot 2025-05-14 071614.png

Screenshot 2025-05-14 071255.pngScreenshot 2025-05-14 071245.pngScreenshot 2025-05-14 071233.pngScreenshot 2025-05-14 071200.pngScreenshot 2025-05-14 071126.png

0 votes
Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 14, 2025

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.

Kurtis
Contributor
May 14, 2025

Done - Thank you

Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 14, 2025

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/ 

Kurtis
Contributor
May 14, 2025

Thank you, but this was unsuccessful. Please see the error in the log screenshot. 

Screenshot 2025-05-14 143635.png

Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 15, 2025

HI @Kurtis 

Based on the action you want, replace the word update with set or add.

Kurtis
Contributor
May 15, 2025

This removed the error, but it doesn't populate the field.

Screenshot 2025-05-15 144822.png

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events