How to get all Teams in JIRA via the cloud rest api?

Christof Bornhoevd May 1, 2023

How can I retrieve all teams in JIRA via the JIRA rest api, something of the form of  /rest/api/3/team 

2 answers

3 votes
Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 1, 2023

Looking at https://MYSITE.atlassian.net/jira/people/search

I see a call to this endpoint:

https://boomaster.atlassian.net/gateway/api/v3/teams/search?organizationId=MYORGANIZATIONID

Which returns JSON that seems to include a bunch of teams.

Oliver Siebenmarck _Polymetis Apps_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 2, 2023

Just two quick notes on that particular endpoint:

That's not part of the product's APIs which means that individual admins can use their personal API tokens to access this, but it is out of reach for Connect and Forge apps.

And if I am not totally mistaken, it's also not part of the official APIs, ie you should not rely on using for any production workload, as you are basically hacking ;-) 

Like Darryl Lee likes this
Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 2, 2023

@Oliver Siebenmarck _Polymetis Apps_ is quite right. This is totally a hack, gathered from sniffing the Search People/Teams page. 

Totally correct that this is probably only usable for unofficial admin work, like one-time scripts, etc. certainly not for apps or production automation things. 

Or if you do use it for such tasks you'll want to make sure you have robust error/sanity checks to confirm the endpoint is still "working".

Christof Bornhoevd May 3, 2023

Thanks a lot for looking into this, Does this mean there is no official endpoint teams in JIRA ?

Like # people like this
Christof Bornhoevd May 3, 2023

Is there a way to get team data via JQL?

Oliver Siebenmarck _Polymetis Apps_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 4, 2023

Hi @Christof Bornhoevd ,

as far as I am aware, there isn't an official REST API to get the teams. @Darryl Lee 's suggestion should work great, but isn't something I would feel comfortable putting into a product that a lot of people rely on. If it were just for me and some one-off scripts, then it would absolutely be the way to go.

The other option you could explore is the GraphQL API which, if I remember correctly, also has some information on teams. Personally, I find GraphQL very weird to work with, but the data should be there. Another thing to keep in mind, is that the GraphQL API does not seem to be meant for marketplace apps, so if that is where you are going with this, then you should check if that would work. Again, for some low-risk internal scripting, it should be more than fine.

Hope that helps,
 Oliver

Evgen Kyselgov June 5, 2023

Hi @Oliver Siebenmarck _Polymetis Apps_ , do you know if there are any plans to add Teams support to the REST API? The commercial application, that i work with, uses a REST API and it would be nice to see Teams support in it.

Oliver Siebenmarck _Polymetis Apps_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 5, 2023

Hi @Evgen Kyselgov ,

Unfortunately, I have no idea. There is a public roadmap here: https://trello.com/b/8XBuIeIu/atlassian-platform-for-developers-roadmap, but it doesn't not mention a teams API. Does not mean that it isn't the works though.

If you really want/need this, it might be a good idea to reach out to Atlassian directly. 

0 votes
Andreas Krupp March 20, 2024

Suggest an answer

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

Atlassian Community Events