How to fetch teams and users using Jira Align API
Platform Notice: Cloud and Data Center - This article applies equally to both cloud and data center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
This article aims to guide the users on how to search/fetch teams and users via API and provide basic calls to achieve it
Please refer to Jira Align Swagger UI for API, calls, and field details. The Swagger UI can be accessed using an internet browser, and a URL with the following syntax:
https://yourinstance.jiraalign.com/rest/align/api/docs/index.html
Solution
Using equal filter
Search by team name with equal demands providing the full name of the team, which should be the same as in Jira Align and will bring as a result only the team provided in the search
API Call: https://yourinstance.jiraalign.com/rest/align/api/2/Teams?$filter=name eq 'TEAM NAME'
Using contains filter
Search by team namewith contains allows to search for a part of the team name and retrieve a list of all the teams that have the provided term within its name (not recommended for a long list of teams)
API Call: https://yourinstance.jiraalign.com/rest/align/api/2/Teams?$filter=contains(name,'KEYWORD')
The contains filter can also be used to filter users and retrieve a list of users with alike first names, last names, or email (not recommended if the list of users is too long). Please find the sample below
First name search with contains
API Call: https://yourinstance.jiraalign.com/rest/align/api/2/Users?$filter=contains(firstname,'User first name')
Last name search with contains
API Call:https://yourinstance.jiraalign.com/rest/align/api/2/Users?$filter=contains(lastname,'User last name')
Email search with contains
API Call: https://yourinstance.jiraalign.com/rest/align/api/2/Users?$filter=contains(email,'User email')
Was this helpful?