The organizations REST API has add/remove users from groups, but not LIST users in group?
I am supposed to switch back to Jira Cloud REST API for that? Why the heck is list members in group missing in organizations REST API?
Hi @KC Wong ,
Of course Organizations Rest API has that feature; but it is a hidden gem. You can check for "Get users in an organization" endpoint.
Here, after adding orgId and directoryId (you can add - for all directories), you can add groupIds as query parameter and it can list the users under that group in the organization.
And the other option is using the group endpoint that @Andrea Robbins mentioned above.
Best,
Hi @KC Wong
The most straightforward supported way to list members of a group is currently via the Jira Cloud Platform REST API group endpoint:
List users in a group (paginated):
GET /rest/api/3/group/member?groupId={groupId}
So for a Jira site, the “group member list” capability exists in Jira’s product API, not in the Org Admin API.
I am guessing the reason is because (unless Atlassian changed it again) that groups are site based and not organization based, or at least not for all organizations. This is due to some customers on the centralized user management experience (where users & groups are managed by the org) vs the de-centralized user experience (where users & groups are managed by site).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm trying to export a list of users and their user group memberships using REST API.
But since the API can only query users belonging to a list of specific groups (from 1 to 10):
1. For each directory in the organization
2. For each user in the directory
3. ???
So you cannot do that. Instead you have to:
1. For each directory in the organization
2. For each group in the directory
3. Get list of members
4. Store the data in a map
Then:
1. For each directory in the organization
2. For each user in the directory
3. Get list of users
4. Check the data stored to find which groups the user has
I also hit HTTP 429 too many request trying to store the membership data (I don't have this problem using Jira Cloud REST API).
At this point I'd rather use two different API tokens and use Jira Cloud REST API.
The Organization REST API is just janky.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.