Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,293,564
Community Members
 
Community Events
165
Community Groups

Default value for Team field when creating new issues

Associating issues to Teams is a crucial part to making advanced roadmaps work. As far as I can see, the best way to do so, is set up teams as shared teams as much as possible and then assign the team to an issue at issue creation.

In our setup, nearly all Jira projects are managed by a core team. The odd task may be assigned to a different team, but as this is more the exception than the rule, I would like to have a default value for the team (pre-populated if possible, filled out automatically if no team is selected otherwise).

However, it seems that the Team custom field is locked and does not allow for configuration changes. And the built-in automation does not support setting the team field - it is not available there.

I know I can make the Team field required upon issue creation, but would really like to help the user here by filling out data we already know in over 90% of the cases for him/her.

Looking for suggestions or workarounds.

1 answer

1 accepted

4 votes
Answer accepted

Hi @Walter Buggenhout _ACA IT_ 

You do need to use a Shared Team, to make it available to set from a Jira issue.

I don't think you can pre-populate on the Create screen, but this is how I populated it during creation using Automation.

--------------

Preparation

You need to use the Team field's custom field ID, and the Team's ID during the rule.

To get the Team field's ID:

  1. Go to Settings (cog icon in top-right) > Issues
  2. Select "Custom fields" from the left-hand menu
  3. Search for the Team field, then select the 3-dots icon on the right-hand side of the field's row and choose "View field information"
  4. Note down the custom field's ID from the URL - eg. customFieldId=10123

To get the Team ID:

  1. Go to Filters > Advanced issue search
  2. Using JQL, enter Team then select the field (Team [Team])
  3. Enter =, then begin to type the name of the relevant Team
  4. Select the Team from the drop-down list, and its ID will be placed in the search bar in place of the name. Take a note of this ID - eg. "Team[Team]" = 5

You can also get the Team ID from a CSV export

--------------

Rule

Go to Automation, and choose to create a new rule. Set the components as follows:

  • Trigger: Issue Created
  • Action: Edit Issue

In Edit Issue, select "More Options" then in the Additional Fields section enter:

{
"fields": {
"customfield_10123":"5"

    }
}

^ In this example, 10123 is the Team field's custom field ID, and 5 is the Team ID

Give the rule a name, then publish it.

--------------

This should set the Team field to the required option just after creation!

Ste

I have implemented and tested this successfully! Thx @Stephen Wright _Elabor8_ - big consistency gain and major time saver!

This was incredibly helpful and did exactly what I was wanting it to. Thanks! 

Has anyone figured out how to do this with a transition post action?

Hi @David Holman 

You could modify this rule to make that scenario work - by changing the Trigger from Issue Created to Issue Transitioned.

It might be possible in a post-function also; what's the use case?

Ste

I was trying to avoid post-function because workflows are so painful to update over time. Automating on the transition got things working ✔️

Not sure if this is a recent change or not but you do not need to find the custom filed ID any more. The following JSON works on my Jira cloud instance:

{
"fields": {
"Team": "6"
}
}

Hi @Darrel Jackson 

This does work, but it could run into problems if you have more than one custom field with the name "Team"

The ID is more secure as it's unique.

Ste

I guess it’s a trade off. I wasn’t aware you could create duplicate custom fields. Then there is the question of whether you should :)

Thanks @Stephen Wright _Elabor8_

Works like a charm, very helpful. 

I'm using Jira Cloud Premium and I have two Team fields.  One for Advanced Roadmaps and the other for Tempo. Both are locked.  Both don't give their custom_Id with View Field Information. 2022-03-23 14_32_39-Configure Custom Field_ Team - JIRA.png2022-03-23 14_33_24-Custom fields - two Team Fields.png

 

CSV download names it Team Id2022-03-23 14_39_41-JIRA (9) - Excel - Team Id.png

I've tried "Team", "Team Id:", "Team[Team]"

none of them work

2022-03-23 14_47_01-Automation - JIRA - Team Id.png

Any ideas?  or does it not work for Cloud?

Hi @Dorothy Krajewski 

The instructions to locate team field ID does work in Cloud (I just checked).

The field ID is in the URL.

Ste

Thank you!  I found it and then tried it in an automation rule. 

Sadly Jira still doesn't like it. 

see pics.   If you have any ideas to get it to work, much appreciated.

2022-03-25 12_08_25-Configure Custom Field_ Team - JIRA.png2022-03-25 12_07_04-Automation - JIRA.png

Hi @Dorothy Krajewski 

Could you try this format in the Additional fields section:

{
"fields": {
"customfield_10123":"5"

    }
}

^ It's not an exact copy of the URL, especially the use of an underscore in the rule, rather than an equals sign in the URL :)

Ste

It worked!!!    I'm so glad.  The work around was going to be extremely admin heavy.  

Thank you!

@Stephen Wright _Elabor8_  thank you very much, this helps a lot.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
Community showcase
Posted in Jira Service Management

Jira Service Management Documentation Opportunities

Hello everyone, Hope everyone is safe! A few months ago we posted an article sharing all the new articles and documentation that we, the AMER Jira Service Management team created. As mentioned ...

203 views 0 5
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you