Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How do I configure an automation rule to set the Teams value based on assignee?

Jennifer Maurer
Contributor
June 27, 2024

I have found similar questions, but the issue may be that I am using Jira Data Center v9.4.15, not Cloud.

I have configured four shared teams in Advanced Roadmaps. I have added the Teams field to my screens. I can manually set the Team value in either Plans or issue screen. My goal is have an automated way to make sure the Team value is always set going forward.

I created a rule triggered when an issue is assigned to a user. If assignee is (a, b, c) then edit Team field to (Team ABC). The issue is that the Team field is not available to be selected in the Edit Issues fields pick list. It is cf(10502) according to the custom fields list. 

Please help!

1 answer

1 accepted

2 votes
Answer accepted
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.
June 27, 2024

Hi @Jennifer Maurer 

First thing, I am using Jira Cloud, and so my suggestions are based on what I know about automation, in general.  With that out of the way...

I believe you may set that field using advanced edit with JSON, in the "More options" section of the Edit Issue action.  To learn more about such edits, please look here: https://confluence.atlassian.com/automation/advanced-field-editing-using-json-993924663.html

For teams, please try this:

{
"fields": {
"Teams": "the id value for the team"
}
}

You will need to find the team id values using example issues, such as with this how-to article, and then searching for the field's value: https://confluence.atlassian.com/automation/find-the-smart-value-for-a-field-993924665.html

Kind regards,
Bill

Jennifer Maurer
Contributor
June 28, 2024

Thank you very much for the info; this worked! 

 

Like Bill Sheboy likes this
Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 3, 2024

@Bill Sheboy , as always, thanks for your expertise in Automation. I am missing the bit on how this works based on assignee though. I have a use case where I want to keep the Team field updated based on Assignee changing.

@Jennifer Maurer , could you share your full automation so that I, and others can benefit? 

I suspect where my use case may be different is that I don't want to create a "hard-coded" scenario in my automation where team members are concerned. Rather I want to lookup the assignee and find the team they are assigned to and then set the Team accordingly. Assuming this "lookup" is even possible, there is one remaining gottcha - what happens when a user is in multiple teams? I want to test that out to see.

Jennifer Maurer
Contributor
July 3, 2024

@Jack Brickey I have four of these branches in my rule, one for each set of team members. 

 

Screenshot 2024-07-03 at 3.40.32 PM.png

Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 4, 2024

Thanks @Jennifer Maurer , that is what I expected. The one obvious challenge here is keeping the rule up to date. If changes are made to one of the Teams the rule will need to change. Hopefully we will get a way to search for any team(s) that a user is in one day.

Like Bill Sheboy likes this
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.
July 4, 2024

Yes, and...

For Jira Cloud, Server, and Data Center, I believe the if / else conditions are a high-maintenance solution.  With Jira Cloud, a Lookup Table would make that slightly easier to maintain.

One would hope for a method to "find the teams for a user", but there is no REST API endpoint to do that yet.  Here is the really old suggestion to add that, but it is tagged with the dreaded "future consideration": https://jira.atlassian.com/browse/JSWCLOUD-20360

Another approach would invert the query direction, and only need to hardcode the team id values.  That would lookup the users for each possible team, one by one, check for membership, and then use that id.  This is the relevant endpoint from the Teams REST API for those wanting to try that: https://developer.atlassian.com/platform/teams/rest/v1/api-group-teams-members-public-api/#api-gateway-api-public-teams-v1-org-orgid-teams-teamid-members-post

 

Like Jack Brickey likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events