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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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,465,122
Community Members
 
Community Events
176
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.

Is there a way to set this up so it only occurs if the teams field is not set?

Hi @Richard Way 

This should work:

  • Trigger: Issue Created
  • Condition: Advanced Compare Condition:
    • First Value = {{issue.customfield_10123}}
    • Condition = equals
    • Second Value = EMPTY
  • Action: Edit Issue
    • {
      "fields": {
      "customfield_10123":"5"

      }
      }

^ The Condition checks that the Team field is empty before completing the action - if it isn't, then it should perform no action and ignore that Issue.

Ste

Like Richard Way likes this

@Stephen Wright _Elabor8_ not having any luck with that.

Looking up the field ID for Team, it comes back as customfield_10001, so I have:

First Value = {{issue.customfield_10001}}
Condition = equals
Second Value = EMPTY


Looking in the Automation audit log after creating an issue I see the run, status is "NO ACTIONS PERFORMED" and action details shows:

ADVANCED COMPARE CONDITION
The following issues did not match the condition:
BYODI-58

Looking at BYODI-58, the Team field is set to None.

Hi @Richard Way 

Is there more than one Team field in your instance?

What does the rest of your rule look like? That is also worth reviewing.

I tested the answer before I posted it, and again just now, and it works as expected :)

Ste

@Stephen Wright _Elabor8_ I'm an idiot... I typed into the second value field the value "EMPTY" when I should have just left the field blank :D 

Works like a charm now!

Awesome, glad it works!

Ste

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS

Atlassian Community Events