Simplifying a Complex Jira Automation Based on Reporter Group Membership

Nicolas Rigaill
Contributor
December 11, 2024

 

 

Hi everyone,

I have an automation that is triggered when an issue of type "Initiative" is created. Its goal is to populate a custom field "Squads contributing" based on the group the reporter belongs to.

Current Setup:

  • The automation checks sequentially if the reporter belongs to one of the 40 predefined squads.
  • If a match is found, the "Squads contributing" field is updated with the corresponding squad.
  • If no match is found, the automation moves to the next condition.
    You can see an excerpt in the attached screenshot.

2024-12-11_15h38_49.png

Challenges:

  1. High Maintenance:

    • If a squad is renamed or a new one is added, the automation needs to be updated manually.
    • This is time-consuming, especially with 40 squads currently configured.
  2. Technical Limitations:

    • Due to the 65-component limit per automation, the setup had to be split into three separate automations. This adds even more complexity.

Question:
Is there a simpler or more efficient way to handle this use case? For example:

  • A more dynamic structure to map the squads?
  • An integration or script that could automatically retrieve the reporter's group membership?

I don’t have ScriptRunner in my environment, so solutions need to rely on standard Jira automations or feasible alternatives within this scope.

Thank you in advance for your help and ideas!

1 answer

0 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 Leaders.
December 11, 2024

Hi @Nicolas Rigaill 

I recommend using a Lookup Table for such mapping scenarios: https://community.atlassian.com/t5/Automation-articles/Update-Create-lookup-table-action-improvements/ba-p/2427798

The rule could first call the REST API endpoint with the Send Web Request action to get all the groups the user is in: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-users/#api-rest-api-3-user-groups-get

https://community.atlassian.com/t5/Jira-articles/Automation-for-Jira-Send-web-request-using-Jira-REST-API/ba-p/1443828

 

With that, your rule would reduce to only a few steps rather than conditions for each group:

  • action: issue created
  • action: re-fetch issue
  • condition: issue type equals Initiative
  • action: Send Web Request to get the groups for the Reporter user
  • condition: check the results of the call
  • action: create lookup table to map the groups to needed values
  • smart value condition: use this to confirm a get() call to the table returns a value
  • action: edit issue, using the get() calls on the table to populate the fields

Maintenance is easier and isolated to updates to the lookup table.

 

What do you want to do if there is no match to the Reporter?

 

Kind regards,
Bill

Suggest an answer

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

Atlassian Community Events