Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Get a Team's ID given it's name

Jared Schmitt
Contributor
May 27, 2025

I want to obtain a Team's ID in order to assign it to a work item or mention it in a comment via automation.

The Teams API only offers me to fetch all teams in a paginated list, but due to the limitations of Jira automations I cannot loop through it to find the matching entry. There is no endpoint that allows me to search for a team by it's name.

Is there any other way to get the ID? If not, is there any open bug report feature request I can vote on to get this feature in 2035?

Thanks for your suggestions 😊

2 answers

1 vote
Aron Gombas _Midori_
Community Champion
May 27, 2025

After a quick look, it seems that the current REST API end-point can't search by name.

Here is a lame workaround that could eventually work:

  1. Get all teams 
  2. Take the returned JSON and using a regex, search for the team name in the JSON string, and take its ID directly from the JSON

I mean, the "all teams" endpoint will return a JSON array like this:

[ { "description": "<string>", "displayName": "<string>", "organizationId": "<string>", "teamId": "<string>", "teamType": "OPEN" } ] }

 It seems possible to match a regex to the "displayName" field, and get the value of the very next "teamId" field.

Of course, if you have a lot of teams, so they are returned in multiple pages, things may get complicated.

Just an idea.

Jared Schmitt
Contributor
May 28, 2025

Hey @Aron Gombas _Midori_ 

Thanks for the suggestion! I had thought about that, but as you mentioned - handling paginated output from the API in an automation rule isn't fun. Do you know of a way to properly loop through such output within automations? Or do I need an external tool that has 'real' deterministic loops?

Aron Gombas _Midori_
Community Champion
May 28, 2025

I don't know what is the right approach with paginated results. (Maybe if it is possible to pass the page size and you pass the maximum allowed, you can save it. But I'm sure you tried this already...)

0 votes
Karan Sachdev
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 27, 2025

Hey @Jared Schmitt

I'd like to clarify if you're looking for the ID of the Team field or the ID of a specific team. Asking this because the article you've linked mentions using the team field's ID as well in the 'Create variable' action.

 

To get the field ID: Go to Settings > Work Items > Custom fields and search for the Team Field. Click on the 3 dots on the far right > View Field Information. The ID is present in the URL. (It is 10001 for the Team system field).

To get the ID of a specific team, select Teams from the top menu, search for the required team, and open its details. Its ID is available in the URL.

Thanks!

Karan Sachdev
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 27, 2025

PS. I believe we don't have an endpoint to search with names because multiple teams can have same names, so it's not a unique identifier.

Jared Schmitt
Contributor
May 28, 2025

Hi @Karan Sachdev 

Thank you for the answer. I'm indeed looking for the ID of a specific team, not the cf. Looking up the ID via UI works, but not in an automation. I need a mechanism to look up the ID via API call etc. It would be OK to receive a list of matching teams & their IDs. The absence of such an endpoint makes it quite difficult to handle some use-cases.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events