Forums

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

Jira Automation: How can I remove items from a list if they appear in a second list?

Carlotta May
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.


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

image.png  

Screenshot 2026-05-05 152720.png

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

image.png

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.

Screenshot 2026-05-05 153050.png 

Screenshot 2026-05-05 153135.png 

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. 

Screenshot 2026-05-05 153817.png

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 :)

 

2 answers

3 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

Carlotta May
May 5, 2026

Hey @Bill Sheboy , 

thanks for your answer. I updated my question and provided screenshots of the whole workflow and added some additional information. I hope the problem and the reason behind it are a little clearer now. 

Its basically like this: I have a list of all space admins from an API. Additionally, there is a list of site admins available via another API. How can I filter the first list of admins to remove all entries that also appear in the second list for site-admins?

Best regards

Carlotta

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 5, 2026

Thanks for the additional information, @Carlotta May 

Based on your scenario / steps description, you could try the techniques I describe in this article to find overlaps between two lists...noting the variations at the bottom of the article for removing overlapping values.

The steps outline might be:

  1. make your first endpoint call to get the space admins
  2. iterate the response message to save the accountId values as a comma-delimited list as text with Create Variable (e.g.: 6207f8c9e5caff0070e46e41,d4494c78-f68a-4cac-8470)
  3. repeat the above steps with your other endpoint call to create another variable
  4. split(",") one of the variables back into a list, and iterate to create a dynamic regular expression, storing that in a third created variable
  5. finally, use that dynamic regex variable to perform the list overlap / removal with the match() function, etc.

 

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