How can I retrieve all teams in JIRA via the JIRA rest api, something of the form of /rest/api/3/team
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.
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 ;-)
@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".
Thanks a lot for looking into this, Does this mean there is no official endpoint teams in JIRA ?
Hi @Darryl Lee , @Oliver Siebenmarck _Polymetis Apps_ , @Evgen Kyselgov , @Christof Bornhoevd
It looks like, there is an API now: https://developer.atlassian.com/platform/teams/rest/v1/api-group-teams-members-public-api/#api-gateway-api-public-teams-v1-org-orgid-teams-teamid-members-post
Just got this from the support. And it is a bit hidden on the https://developers.atlassian.com all the way at the bottom right.
Hope this helps.
Best regards!
Is this API available to Connect apps? And is there anyway to use the API to get a list of all the teams?
Hey so this is a bit old, but since @Andreas Krupp _catworkx_ found the official API and then @[deleted]made sure to emphasize that using the unofficial API that I found is silly and maybe idiotic, I will point out that after @Oliver Siebenmarck _Polymetis Apps_ correctly pointed out that it was unofficial, I replied that he was 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".
This is totally a hack, gathered from sniffing the Search People/Teams page.
THAT BEING SAID: the Official Teams Public API can't actually do what the original poster asked for. Here's what you get there:
Which is... fine, except it assumes you have the Team ID. Where the heck are you supposed to get that when there is no SEARCH or GETALL method?
Look, if somebody can give us some examples of GraphQL, that'd be swell. I mean, will I need to use OAuth? God help me, no.
But I'm going to take a wild guess that the original poster @Christof Bornhoevd was trying to get a list of Teams because Teams are a mess (this is an article I still need to write), and he's just trying to get a handle on HOW MANY teams he has, and what they're named.
The API I found works fine for that, and considering it's still functioning after a year (and I still haven't learned GraphQL) is I guess evidence that sometimes a hack will work.
But YES, you absolutely shouldn't try to write an app in Force or Connect or anything talking to this API. That would definitely be idiotic. ;-}
Totsally right @Darryl Lee !the Official Teams Public API can't actually do what the original poster asked forI believe @it is offensive, to give statements, assessing the "idiocy" of some questions posted. Have a Look at some of the answers!
@Oliver Siebenmarck _Polymetis Apps_ @Darryl Lee
After digging through some other community posts, as well as experimenting with graphQL, here is a way to get all the teams in your organisation:
Inspried by: https://community.developer.atlassian.com/t/invalid-organization-ari-using-teamsearchv2-in-the-graphql-api/77375
Head on to:
https://team.atlassian.com/gateway/api/graphql
get your cloudId and orgId
query tenantData { tenantContexts(hostNames: ["######.atlassian.net"]) { cloudId orgId }}
The call experimental teams search graphql API
query MyQuery { team @optIn(to: "Team-search-v2") { teamSearchV2(organizationId: "ari:cloud:platform::org/ORG_ID_FROM_ABOVE", siteId: "CLOUD_ID_FROM_ABOVE") { pageInfo { hasNextPage } nodes { team { displayName } } } }}
Please note - this API would return a paginated result of pagesize 30, you will need to figure out how to get the next pages, you can specify first: 100 parameters in the teamSearchV2 to get the first 100, but ideally it should be a paginated approach. Ill leave it up to you how to do it
Updating with the below info from the V1 teams rest API, combined with the GraphQL query from Boris got me to:
POST https://{your domain}.atlassian.net/gateway/api/graphql
{ "query": "query getTenantOrg {tenantContexts(hostNames:[\"{your domain}.atlassian.net\"]) {cloudId,orgId}}"}
GET https://{your domain}.atlassian.net/gateway/api/public/teams/v1/org/{your orgId}/teams
Yikes, that's a lot of work to get the Org ID. This might be easier:
It looks like you're new here. Sign in or register to get started.