Missed Team ’24? Catch up on announcements here.

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

Working with Teams in the Atlassian platform GraphQL Gateway

Maggie So
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 17, 2022

The Teams entity, its details, and details of its members can be accessed through the Atlassian platform GraphQL API in an experimental beta query. Teams is available to be queried, read and integrated into applications. Read more about the benefits of creating and using Atlassian Teams for your projects.

Developers are able to fetch Teams data, allowing them to:

  • Attach a team to existing objects

  • Integrate a team dashboard

  • Display the team profile and the members of the team

Authentication

The API authenticates users making requests to fetch a team. Only users with permission can view and access teams.

Read more about authentication from the GraphQL reference documentation.

Team query

A query takes the following form, where 'teamId' is the ID of the team you wish to query:

query getTeam ($teamId: ID!) {
  team {
    team (id: $teamId) {
      id
      displayName
      description
      smallHeaderImageUrl
      largeHeaderImageUrl
      smallAvatarImageUrl
      largeAvatarImageUrl
      organizationId
      creator {
        accountId
        name
        picture
      }
      state
      membershipSetting
      members {
        nodes {
          member {
            accountId
            name
            picture
          }
          state
          role
        }
        edges {
          cursor
          node {
            member {
              accountId
              name
              picture
            }
            state
            role
          }
        }
        pageInfo {
          startCursor
          endCursor
          hasNextPage
          hasPreviousPage
        }
      }
    }
  }
}

The team's ID must be in the form of an Atlassian Resource Identifier (ARI).

The member field can contain additional query parameters:

(first: Int! = 100, after: String, state: [MembershipState!]! = FULL_MEMBER)
  • 'first' describes the number of team members to return and is defaulted to the first 100 members.

  • 'after' is a cursor string describing after which member in the list should the members list start returning.

  • 'MembershipState' describes the state of an individual's membership within a team, taking the values:

FULL_MEMBER, INVITED, ALUMNI, REQUESTING_TO_JOIN
  • The default value is 'FULL_MEMBER', but the parameter can take a list of states and will return any member with those membership states.

The query is defaulted to return the first 100 'FULL_MEMBER's of a team.

Rate limits

Rate limits are applied to users when they send:

  • 40 requests to a team within a minute

  • 20 requests to team members within a minute

These rate limits may be increased or decreased in the future.

Beta state

The Team entity is in Beta state which allows us to monitor and ensure it operates as expected. The Team query requires additional headers to access beta fields:

{
    "X-ExperimentalApi": ["teams-beta", "team-members-beta"] 
}
  • The 'teams-beta' header is required to query a team.

  • The additional 'team-members-beta' header is required to query the members of a team.

Get in contact

Leave some feedback or ask a question through the Atlassian Community.

Read more

Read more about the Atlassian platform GraphQL API and find API reference documentation describing in further detail about the fields of a team and team members.

2 comments

Oleh Vasyliv _Reliex_ February 18, 2022

Hi Maggie,

Thanks for the write up!

Is there any possibility for a Connect-based app to access those GraphQL API (e.g. authenticate as a Connect App user)?

Thanks,
Oleh

Like Ishan Somasiri likes this
Ishan Somasiri
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 20, 2022

Hi @Oleh Vasyliv _Reliex_ ,

Unfortunately not at the moment. Connect apps uses a different authentication approach, Atlassian GraphQL does not support authenticating Connect apps yet.

If this is only for your personal use, you could use an user token instead. Visit https://id.atlassian.com/manage-profile/security/api-tokens to generate your own token. This will unfortunately be suitable for your private apps though.

Regards,

Ishan

Like Oleh Vasyliv _Reliex_ likes this
Oleh Vasyliv _Reliex_ February 21, 2022

Thanks for the answer @Ishan Somasiri ! 

It is for the Connect App to be able to retrieve Teams from Jira (so that users do not need to create and manage teams twice - in Jira and then in the app).

Regards,
Oleh

Amrendra Kumar February 25, 2022

Hi @Maggie So - is there a way to get the list of all teams?

Ishan Somasiri
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 28, 2022

Hi @Amrendra Kumar , such an API does not exist at present unfortunately. For us to look more in to this requirement, could you explain what you meant by "all teams" ?

Is it,

  • All the teams that you are a member of?
  • All the teams that you could see?
  • All the teams from an organization? ( Explanation on organizations)
  • Or is it all the teams that matches a search? (Ex: All the teams that matches a search by team name)?

Looking forward to hear your thoughts.

Amrendra Kumar March 1, 2022

Thanks for your reply @Ishan Somasiri . I was looking to list all the teams that are "open team" which I can join.

The current GraphQL query requires ARI for a team to query but I am not sure if we have that information unless we list that information.

Like dennis.mutia.c likes this
BobbyDaBrick August 26, 2022

Hello! I was trying to use this, but I constantly get an error about malformed ARI, could you give an example of a correctly formatted one?

As a side not I am getting mine from the URL for the team.

Thanks.

Ishan Somasiri
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 28, 2022

Hi @BobbyDaBrick ,

A correct ARI should look like ari:cloud:identity::team/TEAM-ID . TEAM-ID can be found by visiting your team profile and copying the long ID that's shown at the and of the address bar (so how you obtain the team id seems to be correct, it just needs to be prefixed with above).

 

See documentation here for further details. Let us know if you need further help.

Diego Berrueta
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 28, 2022

Hi @BobbyDaBrick ,

A while ago we fixed a typo in our documentation. The format of the team ARI was incorrectly described at https://developer.atlassian.com/platform/teams/teams-graphql-api/using-team-query/ . After fixing the typo, the documentation now reads as follows:

ari:cloud:identity::team/xxx-xxx-xxxx

Can you please confirm that you are trying with that format?

Thank you for using our API.

Like Ishan Somasiri likes this

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events