Two ways to update the Team field

Hello Community!

As we approach the new year I am trying to get a jumpstart on one of my Community New Year's resolutions. Specifically contribute to the community more through articles in 2024.

2024-new-year.gif

In my first contribution I offer up two ways of automatically update the team field. I got the idea for this article while answering a question today so I thought I might extend it to a broader audience via this article.

The first method is using a post function on a transition and the second is using automation. The key, in both cases, is to leverage the team ID which is an obscure number that can be found in the URL of the team page.


Workflow Transition

Let's say that you want to update the team field when an issue is transition to a specific status. In order to do this you simply need to add a post function to the desired transition. The text & images below should help explain this process in more step-by-step detail. Note: This is only applicable to Company managed projects.

  1. Select project settings
  2. Select workflows
  3. Choose the edit (pencil icon) for workflow associated with your issue type.
  4. In diagram mode click on the transition you are interested in and in the model to the right select post functions.
  5. In the post function window click on add post function.
  6. In the next screen select the Update Issue Custom Field radio button.
  7. In the next screen choose Team as the field to be updated and in the value box enter the Team ID (the obscure number at the end of your URL). This is illustrated in the image below.
  8. Save and publish your workflow.
  9. Test everything out.

2023-12-29_13-34-35.jpg


Automation

While the post function method and use case is rather specific and possibly limited, automation allows you to expand the potential cases considerably. This is because you can leverage different triggers and, more importantly, conditions under which you could set the desired team to the Team field. With that said, I will not focus on the various triggers or conditions since that isn't the primary focus of this article. Rather, I will simply provide the syntax for the action to set the Team field.

  1. Select project settings in the desired project and then choose automation.
  2. Click on create new rule and enter your desired trigger and conditions.
  3. For the action choose edit issue and then enter team in the field to be edited.
  4. Rather than selecting the Team from the drop-down value field choose the more option and enter the following JSON in the provided box.
{"fields":{ "Team":"332dd9fc-59d6-48e8-b882-4ae6580732df" }}

Save the rule and test it out!

 

Please share your thoughts and ideas in the comments so that others might benefit from community sharing!

Have a wonderful new year all!!

9 comments

Fabian Lim
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 30, 2023

Thanks for sharing. With the introduction of the new teams custom field this will become very useful for assigning tickets to specific teams. 

Rodolfo Romero - Adaptavist
Contributor
April 2, 2024

Is there a way to get the id of the team automatically based on its name that maybe is saved in another field?

Dalcina Duval
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 2, 2024

hi team, I tried using this in my automation and it doesnt work - i keep getting an error message stating the  field i added is invalid

 

{
"fields": {
"Team" : "TEAM ID" }}

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 2, 2024

Hi @Dalcina Duval -- Welcome to the Atlassian Community!

Context is important for automation rule questions.

I recommend creating a new question, adding a link back to this thread, and including images of your complete rule, the action details where you are using that JSON, and the audit log details showing the rule execution.  Those will help the community see that JSON in context to better make suggestions.  Thanks!

Kind regards,
Bill

Charlie Misonne
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 18, 2024

For anyone looking for the Data Center solution:

{
    "fields": {
        "customfield_10304": "{{issue.Team.id}}"
    }
}

Where customfield_10304 is the ID of the Team field.

{{issue.Team.id}} is basically a number. In my example I was creating a new issue with the Team value from the trigger issue.

Aaron Geister
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 11, 2024

It would be really nice if we could use this method to @ the team in comments at the same time in an automation.

Like Charlie Misonne 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.
November 11, 2024

Hi @Aaron Geister 

Here is one of the suggestions to add that feature to rules: https://jira.atlassian.com/browse/JRACLOUD-80134

Kind regards,
Bill

Like # people like this
Aaron Geister
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 11, 2024

@Bill Sheboy 

So in the JSON you can use:

[~accountId:team ID]

Is that look like the same format as the Team field? 

 

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.
November 11, 2024

I believe that is the suggest format to add to rules, and it does not work yet, to the best of my knowledge.

The workaround is to add each user in the team as a separate mention.

Like Aaron Geister likes this

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events