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
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 :)
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:
Kind regards,
Bill
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Trudy Claspill
thanks for your brainstorming!
My for each branch is defined like this:
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.