Missed Team ’24? Catch up on announcements here.

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

Default value for Team field when creating new issues

Walter Buggenhout
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 21, 2020

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
Stephen Wright _Elabor8_
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 21, 2020

Hi @Walter Buggenhout 

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

Walter Buggenhout
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 23, 2020

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

Elliot Gates December 21, 2020

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

Deleted user December 30, 2020

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

Stephen Wright _Elabor8_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 1, 2021

Hi @[deleted] 

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

Deleted user February 3, 2021

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

Darrel Jackson August 15, 2021

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"
}
}
Stephen Wright _Elabor8_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 18, 2021

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

Darrel Jackson October 14, 2021

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 :)

Nick March 16, 2022

Thanks @Stephen Wright _Elabor8_

Works like a charm, very helpful. 

Dorothy Krajewski March 23, 2022

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?

Stephen Wright _Elabor8_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 23, 2022

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

Dorothy Krajewski March 25, 2022

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

Stephen Wright _Elabor8_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 25, 2022

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

Dorothy Krajewski March 31, 2022

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

Thank you!

Jerome Arnoldi April 28, 2022

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

Richard Way November 10, 2022

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

Stephen Wright _Elabor8_
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 26, 2022

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
Richard Way December 29, 2022

@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.

Stephen Wright _Elabor8_
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 29, 2022

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

Richard Way December 29, 2022

@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!

Stephen Wright _Elabor8_
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 29, 2022

Awesome, glad it works!

Ste

Stephen Wright _Elabor8_
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 30, 2023

In case anyone finds this question in future, the Team field has been modified and the instructions now differ slightly:

---

Prerequisite 

You'll need the Team custom field ID, and the Team ID.

Custom Field ID...

  • Go to Settings (cog icon in top-right) > Issues
  • Select Custom Fields from the left-hand menu
  • Search for the "Team" field
  • Next, select the breadcrumbs (...) in line with the field, and choose View field information
  • The ID is in the URL - eg. ?customFieldId=10001

And Team ID...

  • On the top navigation bar, select Teams > Search people and teams
  • Locate and select your Team
  • The ID is in the URL, and is a long alphanumeric phrase - eg. /team/5p4894e7-1ef5-6wp1-8erq-7r3hgq43ej9q

---

The Rule

The rule then might look like this...

  • Trigger: Issue Assigned
  • Action: Edit Issue
    • More Options...
      • Advanced...
        • {
          "fields": {
          "customfield_10001":"5p4894e7-1ef5-6wp1-8erq-7r3hgq43ej9q"

          }
          }

Ste

Like Darrel Jackson likes this
Darrel Jackson December 3, 2023

Good update. Worth noting the previous solution still works as the Team ID's are backwards compatible.

Suggest an answer

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

Atlassian Community Events