Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,558,787
Community Members
 
Community Events
184
Community Groups

how to list all teams using rest api

how to list all teams using rest api

1 answer

0 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.
Mar 29, 2023 • edited

Hi @Tushar Wagh - poking around on my Teams page, I think you need to use the GraphQL API.

Oh right, here's an announcment:

On my account, I see a POST to this endpoint:

https://MYSITE.atlassian.net/gateway/api/directory/graphql?q=TeamMembership
With this payload:
{
  "query": "query TeamMembership($teamId: String!, $membershipState: [TeamMembershipStatus], $enableV3: Boolean) {\n    TeamMembership: TeamMembership(teamId: $teamId, membershipStates: $membershipState, enableV3: $enableV3) {\n      user: profile {\n        id,\n        fullName,\n        title,\n        avatarUrl,\n        timezone,\n        status\n      },\n      state:membershipStatus,\n      role,\n      membershipId {\n        teamId, memberId\n      }\n    }\n  }",
  "variables": {
    "teamId": "399368c8-c7cc-4d48-bc05-17e05a192f61",
    "membershipState": [
      "FULL_MEMBER",
      "INVITED"
    ],
    "enableV3": true
  }
}
And the response was a nice big blob of JSON that included the queried attributes for the three team members I just added.
Now do I understand how any of that works? Ha, nope! But I think the main thing is that's my teamId, same as show in the URL for my team:
https://MYSITE.atlassian.net/jira/people/team/399368c8-c7cc-4d48-bc05-17e05a192f61
I think you could use the teamSearch query to lookup the ID for a team?
So yeah, I don't actually have any experience with GraphQL, but hopefully this is enough to get you started.

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