Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
  • Community
  • Q&A
  • Jira
  • Questions
  • Jira Automation: How to aggregate results from a "for each" branch without overwriting values?

Jira Automation: How to aggregate results from a "for each" branch without overwriting values?

Carlotta May
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 1, 2026

In a self-service we want the users to be able to request who the space admin of a jira (and soon also confluence) space is. Users created a SR where they enter the project key as text input. The goal is for the automation to respond to the users request with one comment listing the valid admins.

We then use an automation with the following logic: 

- send web request to rest/api/3/user/permission/search?projectKey={{issue.summary}}&permissions=PROJECT_ADMIN to get all project admins in a certain space

- branch over all returned admins: inside the branch we apply two filter

  • ignore users of type app

image.png 

  • send another web request rest/api/3/user/groups?accountId={{adminUser.accountId}} and check the user's group. 
  • Only if an admin is not in the group site-admins, it is a valid space admin we want the requestor to know.

image.png

The problem now is, that we do not want to write all valid admins in a different comment, as there are some times a lot of space admins. 

We tried several ways of "storing" the valid admins like in a custom user-picker field or in a variable. But there is always the same problem: as branch executions run in parallel, the values frequently overwrite each other, so that in the end not all admins are stored. Even in small tests we sometimes only end up with 2 out of 3 admins saved, although the audit log correctly shows that all admins were processed.

Is there any reliable way in Jira automation to aggregate results from a branch without overwriting each other? Do you have an idea? Maybe a high complex concatting of JSONs?

Thanks a lot :)

3 answers

2 votes
Bill Sheboy
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 Champions.
May 1, 2026

Hi @Carlotta May -- Welcome to the Atlassian Community!

Without seeing your entire rule and audit log details, and the what is the purpose / "why do this" for the rule, to provide context...

 

As you note, branches which could be on more-than-one-thing process in parallel and asynchronously.  Thus, branches cannot accumulate results for such cases.  Possible workarounds depend upon the scenario to be solved.  For example:

  • For simple field aggregation, try list functions such as sum, max, min, etc. 
  • When you need to detect a condition within a list of values and then take action for the remaining list items, please try smart value list filtering and then use list iteration or branching over the remainder.  Occasionally, this can also be solved with a Dynamic Lookup Table.
  • For non-trivial filtering of lists, use dynamic list filtering, as described in this article I wrote 
  • When performing multiple actions for an unknown number of list items, with more dynamic filtering, a recursive rule technique may be used, where one rule chains to another with an Incoming Webhook Trigger...which then calls itself using the Send Web Request action 
  • etc.

 

Kind regards,
Bill

0 votes
EthanCole
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 1, 2026

Thanks for the suggestion! I haven’t tried writing the values to a text field yet, but that sounds like a practical workaround. I’ll test appending values during the For Each branch and then use a delay before creating the comment to make sure everything is captured correctly. I’ll share my branch configuration and results after trying this approach.

0 votes
Trudy Claspill
Community Champion
May 1, 2026

Hello  @Carlotta May 

Welcome to the Atlassian community.

Can you share the details of your For Each branch step configurations?

Have you tried writing the values to a text or paragraph field in the issue, appending each value as you loop through the branch? After the branch you could add a step to then create a comment including the content from that field, then clear the field after creating the comment. You might have to put a Delay step after the branch and before the Comment action to ensure the branch has time to complete before the comment is created.

I'm just brainstorming. I have not tested this idea.

Carlotta May
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 1, 2026

Hey @Trudy Claspill 

thanks for your brainstorming!

My for each branch is defined like this:

image.png

I tried to store the admin names in the description field of the issue, but there was the same problem with overwriting as the edit work item actions may work in parallel. :/

I also did re-fetchs befor each and delays before commenting.

Suggest an answer

Log in or Sign up to answer