HI Team,
I am consuming JIRA Rest API V2. In that i want to fetch all the roles by pasisng user name/id.
GET /rest/api/2/user -> this method is not fetching the roles.
Could you help to get the correct api that will return all roles based on user.?
Thanks,
Loganayaki
Hello @Loganayaki
You cannot get project roles based on a user, only actors (users) based on a project role, which is done via the Get project role actors for role endpoint.
Hi @David Bakkers ,
Thanks for your quick response. is there any way to get user roles by using below api?
GET /rest/api/2/user
It shows application roles in API result. but values are not shown.
Thanks,
Loganayaki
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The values aren't shown, because the applicationRoles element needs to be expanded. When you look at the response from the REST API, that information is provided:
"expand": "groups,applicationRoles"
If you expand the applicationRoles element, you will get all the items within it. In the case you've shown above, there is one (1) item inside the items array.
Review the resulting data and determine for yourself if it does or doesn't satisfy what you consider to be 'roles' for that user.
Good luck on your learning journey
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.