Getting all users that belong to a Portfolio in Jira Align
Summary
There is no simple way (like using a Filter or something like that) to extract all the users that belongs to a Portfolio.
This article presents two different approaches how to create a list of users that belongs to a Portfolio based on Portfolio Team information.
Environment
Jira Align
Solution
When Jira Align users are added to a Portfolio, they are also added as members of a Portfolio Team. The Team information resides on User Record and can be retrieved in two ways:
By checking the Portfolio Team information on the Teams tab of User Records
By checking the “teams” collection via API Call
How to get a list of users?
Approach 1 - Via Export feature
Pros | Cons |
---|---|
No additional knowledge, on Jira Align side, is required | Additional actions on Excel are required to filter full data |
By exporting the data once, you will have a list of all users | The generated data is not properly structured |
Steps to be followed:
Go to Jira Align Administration > ACCESS CONTROLS section > People
Click on the button More Actions > Export
Save the Excel file generated
In the column Assigned Teams of the Excel file generated, there are all Teams (including the Portfolio Teams) that each user belongs to.
As mentioned in Pros/Cons table above, the generated data is unstructured. On the Assigned Teams column, all Teams for each user are comma-separated values, so for a user, there are a lot of teams, including the Portfolio Team. A lot of actions/filters need to be used on the Excel side.
Approach 2 - Via API Calls
Pros | Cons |
---|---|
Filter by a specific Team (including Portfolio Team) | Basic API Calls knowledge is required |
The output data can be restricted for what you are looking for: eg First/Last Name and Email address | Due to the number of records that can be returned in a GET API call, in Jira Align there is a limitation of 100 items to be returned in a single call. If you have 200 items to be returned, two calls are required, if you have 300 records to be returned, three calls are required, and so on. Using Pagination, you must loop through batches of 100 to get all items. |
Steps to be followed:
Go to Teams grid and take note of the ID of the team you are looking for eg 1234 - XYZ Portfolio Team
Using an API Client (Postman, Insomnia, etc) make a call on Users endpoint filtering by the TeamID that you identified in Step 1 (on this example 1234). The GET API Call should be something similar to:
https://<yourJAsite>.jiraalign.com/rest/align/api/2/Users?$filter=teams/any(t:t/teamId eq 1234)&$select=id,firstname,lastname,email
Replace <yourJAsite> with your Jira Align site, and the team ID in any(t:t/teamId eq 1234)
The response body will provide a list of users (containing ID, First Name, Last Name, and email address based on $select used) that belong to the XYZ Portfolio:
[
{
"id": 661715,
"firstName": "51",
"lastName": "Cent1",
"email": "51Cent@agilecraft.com"
},
{
"id": 661819,
"firstName": "Marmot",
"lastName": "Woods",
"email": "mwoods@agilecraft.com"
},
{
"id": 661823,
"firstName": "Clint",
"lastName": "Stark",
"email": "clintstark5@agilecraft.com"
}
]
As mentioned in Pros/Cons table above, if your results have more than 100 records, you need to run multiple calls using the Pagination feature (for example by adding &$skip=100 to the end of the request URL).