How to filter users by their team information when using the Jira Align REST 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 shows how to use the $filter query parameter to find users based on the team information (such as Id/name/roleId) they are member of.

Environment

Jira Align

Solution

⚠️ The examples in this article come from a test environment

Assume you have a team with a configuration similar to the following

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 { "id": 2063, "name": "FXP Portfolio Team", "ownerId": "661802", "regionId": 16, "programId": 1179, "type": 5, "isActive": 1, "description": "FXP Portfolio team", "sprintPrefix": "FXP", "shortName": "FXP", "trackBy": 1, "maxAllocation": null, "allowTaskDeletion": 0, "allowTeamToRunStandup": 0, "isKanbanTeam": null, [..] "self": "https://-------.jiraalign.com/rest/align/api/2/teams/2063" }

and would like to find all the users that are members of this team.

The users endpoint will give you a collection (array) of teams fields under each user such as:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 { "id": 661838, "uid": "661838", "firstName": "FrancoisGmail4", "lastName": "PANAGETGmail4", "fullName": "FrancoisGmail4 PANAGETGmail4", "email": "---------", "userStartDate": "2022-10-19T00:00:00Z", [...] "isLocked": 0, "status": "Active", "regionId": 17, "title": "SUPER TITLEzz11", "roleId": 91, "cityId": 32, "divisionId": 65, "costCenterId": 1, "holidayRegionId": 17, "holidayCityId": 32, [...] "enterpriseHierarchy": null, "teams": [ { "teamId": 2063, "teamName": "FXP Portfolio Team", "teamType": 5, "roleId": 12, "roleName": "TeamOfTeam" }, { "teamId": 5983, "teamName": "FxPTigerK", "teamType": 1, "roleId": 8, "roleName": "Architect" }, [...] { "teamId": 6293, "teamName": "FXPProgram 3 Team", "teamType": 2, "roleId": 9, "roleName": "Stakeholder" } ], "self": "https://-------.jiraalign.com/rest/align/api/2/users/661838" } ]

Although the documentation does not explicitly say the filtering on a collection (array) is supported by the users endpoint you can query on the ‘teams’ collection (array), for example for the teamId, with the following syntax (where 2063 is the numeric ID of the team):

/users ?$filter=teams/any(t:t/teamId eq 2063)

Using the Postman application this would the result in an output similar to the below (noting that in the example 'select' has also been used to reduce the displayed fields):

(Auto-migrated image: description temporarily unavailable)

Related Content:

References:

Updated on April 14, 2025

Still need help?

The Atlassian Community is here for you.