I'm trying to use the REST API to list all users from a group and if I'm logged in as an administrator I can use this endpoint and it lists the info that I want:
/rest/api/2/group?groupname=my-group-name&expand=users
However if I try to use this endpoint as a user that only has the "Browse Users" permission I get an authorization error:
{"errorMessages":["You are not authorized to perform this action. Administrator privileges are required."],"errors":{}}
Based on the documentation it seems like that permission should be all that I need but I must be missing something:
Browse Users
Ability to select a user or group from a popup window as well as the ability to use the 'share' issues feature. Users with this permission will also be able to see names of all users and groups in the system.
My question is: Should I be using a different endpoint to list this information? Is the only way to list this info giving administrator access to the rest API user ? Any other ideas I can try?
Thanks in advanced,
Abe
I'm not sure if there are any other options, but in the documentation, that function is listed as requiring admin privileges:
You are probably looking for https://docs.atlassian.com/jira/REST/latest/#d2e160 :
/rest/api/2/groupuserpicker
Returns a list of users and groups matching query with highlighting.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Matheus, thanks for your help. Unfortunately that endpoint is not what I'm looking for unless I'm not understanding how to use it well. What I need to do is to be able to retrieve all the users from a particular group. The endpoint that you suggested seems useful to find all the users or a group that match a specified query. Did I miss something?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, what I wanted to say is that that is (one of) the API that checks the Browse User permission: "Ability to select a user or group from a popup window as well as the ability to use the 'share' issues feature." That is the API to select a user or group :)
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.
Hi Abe,
Actually, that error message is correct. Viewing all the users that are members of a given group is an administrative task, so only users with administrative permissions can perform this action.
I hope this helps.
Cheers,
Clarissa.
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.