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 ;-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks a lot for looking into this, Does this mean there is no official endpoint teams in JIRA ?
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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.
To anyone else who stumbles on this thread, I would like to make a personal statement in support of what @Oliver Siebenmarck _Polymetis Apps_ said
The REST API endpoint at:
https://{yourDomain}.atlassian.net/gateway/api/v3/teams/search
is an internal one used for creating content for Jira's GUI. You're not supposed to be accessing directly! Don't use it and expect support from anyone at Atlassian.
Use the official Teams REST APIs that @Andreas Krupp has mentioned
If you're silly enough to use internal API endpoints directly, despite being warned not to, then that's your problem. But, for goodness sake, don't come over to the Developer's Community with idiotic questions about how you can't get it to work with method XYZ or function in Forge, Connect, or whatever else.
/rant
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oh hey, I don't mean to be silly and I would NEVER ask an idiotic question over in the Developer's Community, but I was just poking at this because, ugh, we have so many teams now.
I wanted to point out that the internal unofficial endpoint I provided above actually returns MORE RESULTS and MORE DATA than the official one (that sometime between August and October 2024 added the call to list all teams):
https://{YOURSITE}.atlassian.net/gateway/api/public/teams/v1/org/{YOURORGID}/teams
So, that official API endpoint only returns 48 teams.
But when I "Browse all teams" in the UI I see 80 (ugh) Teams created by my users. And lo and behold, the internal unofficial API endpoint also returns 80 Teams.
Looking at what the unofficial API endpoint returns, I don't see any difference between one of the Teams "missing" from the unofficial API response and one that is visible both in the UI and in the unofficial API response. Here's two such Teams:
{
"id": "ari:cloud:teams::team/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXX",
"displayName": "DEVREL Comm Approvers",
"description": "",
"state": "ACTIVE",
"discoverable": "DISCOVERABLE",
"membershipSettings": "MEMBER_INVITE",
"restriction": "ORG_MEMBERS",
"organizationId": "{MYORGID}",
"pseudoOrganizationId": null,
"memberCount": 4,
"includesYou": false,
"isVerified": false,
"largeHeaderImageUrl": "https://ptc-directory-sited-static.us-east-1.prod.public.atl-paas.net/gradients/6.svg",
"smallHeaderImageUrl": "https://ptc-directory-sited-static.us-east-1.prod.public.atl-paas.net/gradients/6.svg",
"largeAvatarImageUrl": "https://ptc-directory-sited-static.us-east-1.prod.public.atl-paas.net/teams/avatars/6.svg",
"smallAvatarImageUrl": "https://ptc-directory-sited-static.us-east-1.prod.public.atl-paas.net/teams/avatars/6.svg"
},
{
"id": "ari:cloud:teams::team/XXXXXXX-YYYY-YYYY-YYYY-XXXXXXX",
"displayName": "Spoken Subs",
"description": "",
"state": "ACTIVE",
"discoverable": "DISCOVERABLE",
"membershipSettings": "MEMBER_INVITE",
"restriction": "ORG_MEMBERS",
"organizationId": "{MYORGID}",
"pseudoOrganizationId": null,
"memberCount": 6,
"includesYou": false,
"isVerified": false,
"largeHeaderImageUrl": "https://ptc-directory-sited-static.us-east-1.prod.public.atl-paas.net/gradients/5.svg",
"smallHeaderImageUrl": "https://ptc-directory-sited-static.us-east-1.prod.public.atl-paas.net/gradients/5.svg",
"largeAvatarImageUrl": "https://ptc-directory-sited-static.us-east-1.prod.public.atl-paas.net/teams/avatars/5.svg",
"smallAvatarImageUrl": "https://ptc-directory-sited-static.us-east-1.prod.public.atl-paas.net/teams/avatars/5.svg"
},
But anyways, the official API does only has "Spoken Subs", not "DEVREL Comm Approvers", and there's much less data:
{
"teamId": "XXXXXXX-YYYY-YYYY-YYYY-XXXXXXX",
"organizationId": "{MYORGID}",
"displayName": "Spoken Subs",
"description": "",
"teamType": "MEMBER_INVITE"
},
The IDs do match.
SO UH, yes, UNOFFICIAL. Idiotic. Silly!
But also more accurate?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yikes, that's a lot of work to get the Org ID. This might be easier:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is this API available to Connect apps? And is there anyway to use the API to get a list of all the teams?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey so this is a bit old, but since @Andreas Krupp found the official API and then @David Bakkers 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".
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. ;-}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Totsally right @Darryl Lee !
the Official Teams Public API can't actually do what the original poster asked for
I believe @it is offensive, to give statements, assessing the "idiocy" of some questions posted. Have a Look at some of the answers! :D
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Darryl Lee @Boris Zozoulia Interestingly Official Teams Public API has a GET
Get a list of teams api now. Not sure if this was released recently.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It can be used. You could have a try @siruntamable
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It works but getting the orgId was a pain, I ended up using the graphql api to get the orgId as mentioned above in one of the comments.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For @siruntamable and others, here's the official guidance on how to find your Organization ID:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Darryl Lee , the endpoint you provided
https://boomaster.atlassian.net/gateway/api/v3/teams/search?organizationId=MYORGANIZATIONID
proved to be very useful.
Would it be possible to also retrieve the team members for each team?
Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Update: I've found a way to get team members
We can do this by using official endpoint provided by atlassian
Does anyone know how to paginate the endpoint provided by @Darryl Lee?(I'm getting only 99 teams)
startAt doesn't work.
Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ugh. So yeah, turns out it's a bad idea to use a hack. :-}
It looks like Atlassian is no longer using the endpoint I found. :-{{
The People and teams page (https://YOURSITE.atlassian.net/jira/people/search/teams) is ONLY using graphql calls now to find all the Teams, which @Boris Zozoulia documented above.
I'm looking at the Developer panel and seeing a POST to this endpoint:
Returns the search result for teams matching the given query in the specified site and organization. Please provide siteId if present, in its raw id form (i.e. not ARI). If siteId is not present, please provide "None" string. Query can be empty. Optionally a limit (max 100), sort and a cursor can be supplied.
Ugh, yeah, so then you have to dig out pageInfo.endCursor from each response, and use that in the after part of the GraphQL query, which is weird, because that argument isn't documented as such, and you would _think_ that you should instead be submitting pageInfo.startCursor.
Feh, I guess this is standard GraphQL: https://graphql.org/learn/pagination/
Shudder.
Perhaps I should play with graphqurl or something that makes this less scary for me.
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.