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.
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:
To get the Team ID:
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:
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 @Ste Wright - big consistency gain and major time saver!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This was incredibly helpful and did exactly what I was wanting it to. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Has anyone figured out how to do this with a transition post action?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I was trying to avoid post-function because workflows are so painful to update over time. Automating on the transition got things working ✔️
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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"
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Ste Wright
Works like a charm, very helpful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
CSV download names it Team Id
I've tried "Team", "Team Id:", "Team[Team]"
none of them work
Any ideas? or does it not work for Cloud?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The instructions to locate team field ID does work in Cloud (I just checked).
The field ID is in the URL.
Ste
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It worked!!! I'm so glad. The work around was going to be extremely admin heavy.
Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Ste Wright thank you very much, this helps a lot.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is there a way to set this up so it only occurs if the teams field is not set?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Richard Way
This should work:
^ 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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Ste Wright 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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Awesome, glad it works!
Ste
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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...
And Team ID...
---
The Rule
The rule then might look like this...
{
"fields": {
"customfield_10001":"5p4894e7-1ef5-6wp1-8erq-7r3hgq43ej9q"
}
}
Ste
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Good update. Worth noting the previous solution still works as the Team ID's are backwards compatible.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.