How to create an automation for assigning a team to the tickets created in a certain project?
Asked by Diana Melkumyan:

**Objective:**

Get Advanced roadmaps to display all the items in a certain project with projected sprints.

![Screen Shot 2022-03-24 at 1.55.35 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/189900i23C282A0C53EE926/image-size/large?v=v2&px=999 "Screen Shot 2022-03-24 at 1.55.35 PM.png")

**Actions taken:**

I have created a project specific Advanced Roadmap. As far as I know, in order to see the sprints and projected sprints on top of the roadmap, I needed to group by Team. I have created a Team in Jira.

**Problem:**

When trying to set up automation to set the Team field to "Loyalty" for all the new issues, Jira only allows to select "Team\[Dropdown\]" and not "Team\[Team\]". I've tried doing it via JSON too, but it doesn't recognize the field any way I'm putting it and I don't have the field ID, as it's not a custom field.

What I see when selecting the Team field in the automation:

![Screen Shot 2022-03-24 at 1.59.56 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/189902i55E21BD65B52B797/image-size/large?v=v2&px=999 "Screen Shot 2022-03-24 at 1.59.56 PM.png")

What I want to see is the Shared Teams we have configured in Jira for the organization:

![Screen Shot 2022-03-24 at 2.01.35 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/189904i1A75CB49E7AACC54/image-size/large?v=v2&px=999 "Screen Shot 2022-03-24 at 2.01.35 PM.png")

**Expected result:**

Any issue that is created in the project updates the little progress bar on the sprint in Advanced Roadmaps.


Answers:
author: Diana Melkumyan
body: You have to use the field ID. You can find it at *\[your_attlassian.url\]*/secure/admin/ViewCustomFields.jspa , find the field and click on "View information". The id will be available in the URL as in /secure/admin/ConfigureCustomField!default.jspa?customFieldId=11300

Then you need to configure the automation to use advanced options and configure it with the field ID and the team ID as follows

```

{
"fields": {
"customfield_10114": "56"
}
}?
```

Credits to [@John Haworth](/t5/user/viewprofilepage/user-id/4274059) ! I will also willingly accept your answer if you repost this, John!


author: Rick Olson
body: You have to set the team using the team number, like I show below. If you need to figure out how to get your team number for a team, take a look at my answer in this post: [Locating your team number](https://community.atlassian.com/t5/Advanced-Roadmaps-questions/Why-is-the-Team-field-not-added-to-screens-by-default/qaq-p/1965987#M8618) ![SetTeamNumber.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/189905i3A5819C2633A4D05/image-size/large?v=v2&px=999 "SetTeamNumber.PNG")

comments: author: Diana Melkumyan
body: I really appreciate your response. Unfortunately, that was one of the variations I've tried before and it brings me this error.

![Screen Shot 2022-03-28 at 8.49.28 AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/190214i6DA28FF209F19361/image-size/large?v=v2&px=999 "Screen Shot 2022-03-28 at 8.49.28 AM.png")

I've tried this with and without spaces, with and without quotes, lower case and uppercase and camel case. Any syntax I've tried brings the same error: *Additional fields contains invalid field(s) in 'update' or 'fields' section: Team*

The screenshot below confirms that the team number is correct. I'm getting the 228 issues as I should be.

![Screen Shot 2022-03-28 at 8.52.11 AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/190215iA83899C846A7A676/image-size/large?v=v2&px=999 "Screen Shot 2022-03-28 at 8.52.11 AM.png")

I'm probably missing something stupid, so I'd really appreciate your guidance.


author: Rick Olson
body: Hello there!

I took some screen shots for you in hopes that these will guide you on assigning a specific team when an issue is created.

In my example, I automatically assign all new bugs to a specific team. The team is number 177 (a.k.a. POC Team A).

Here are the three screens:

1. The configuration screen for the automation showing the Team field being set to 177.

2. The Audit log showing a new bug being added.

3. The resulting issue screen showing that the new bug has the team set to 'POC Team A'.

![Bug1.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/191455i1A5E498F783AA352/image-size/large?v=v2&px=999 "Bug1.PNG")

![Bug2.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/191457i3AC3A4C591121950/image-size/large?v=v2&px=999 "Bug2.PNG")

![Bug3.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/191447i29B1C60AD300DD95/image-size/large?v=v2&px=999 "Bug3.PNG")


author: Rick Olson
body: Diana - Did this work for you?


author: Diana Melkumyan
body: Hi [@Rick Olson](/t5/user/viewprofilepage/user-id/3741809), I appreciate the follow up. As per my 2nd comment, I have already tried that (and retried just now). The validation on this query fails.

```
{
    "fields": {
        "Team" : "14"
    }
}
```

Here's the screenshot.![Screen Shot 2022-05-30 at 11.52.23 AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/199836iA5EE804A02E51EBE/image-size/large?v=v2&px=999 "Screen Shot 2022-05-30 at 11.52.23 AM.png")

In the comment above I have also attached a screenshot confirming the team number is correct.

I have tried to make the rule specific to an issue type. That doesn't work either. Same validation error.  

Can you post your query here, so that I can try just by copy pasting? I really don't know what else to do :(


author: John Haworth
body: Took me a while but I got this one sorted

Team doesn't work you have to use treat it as a custom field ID which you can find in the custom field edit screen in the url

i.e.

secure/admin/EditCustomField!default.jspa?id=10114

convert that to referencing issue fields docs here [Advanced field editing using JSON \| Cloud automation Cloud \| Atlassian Support](https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/)

customfield_10114

my example is below (which works for me) your field ID and team will be different

> {  
> "fields": {  
> "customfield_10114": "56"  
> }  
> }


author: Leo
body: John's solution worked for me. Thanks, John!  

It's surprising that we have to go thru all of this (e.g., getting custom-field ids from URLs) to be able to consistently show sprints in Jira Advanced roadmaps...


author: Diana Melkumyan
body: Thank you, this works!

For others, you can find the custom fields in the UI here: https://\[your_handle\].atlassian.net/secure/admin/ViewCustomFields.jspa

Team field is not edittable, but you can still find the ID in the URL by clicking on "View information"


Tags: advanced-roadmaps

automation