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.
Main Goal of Automation: List all admins of a space, but exclude app users and site admins.
A list of all admins is available via API call, the user type is simply an attribute. Site admins are listed seperately and therefore need another API call.
Since we have Jira Enterprise available, I used advanced components for the automation.
The automation follows the 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
{{adminUser}} is hereby defined as: {{webResponse.body}}
The answer we get is something like this:
{self=https://api.atlassian.com/ex/jira/<cloudId>/rest/api/3/user?accountId=<id>, accountId=<id>, accountType=app, emailAddress=, avatarUrls={48x48=…, 24x24=…, 16x16=…, 32x32=…, displayName=<accountName>, Charts, and Dashboards, active=true, timeZone=Europe/Berlin, locale=en_US}
We care about the accountType, accoundId and displayName.
- then ignore users of type app
- send another web request rest/api/3/user/groups?accountId={{adminUser.accountId}} and check the user's group.
The API requesting a users group returns a list of all groupNames the certain user is a member of.

groupNames is hearby defined as Smart value: {{#webResponse.body}}{{name}},{{/}}
- Only if an admin is not in the group site-admins, it is a valid space admin we want the requestor to know.
Here you can see, that I tried storing the admins, that we want to return to the user in a custom field (user-picker). But it did not work. Thats just one way we tried.


The problem is, that want to return all valid admins in one comment to the customer in the end.
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.
The technical question is basically: How can I filter the first list to remove all entries that also appear in the second list (and exclude app users based on a specific attribute)?
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 