Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,466,295
Community Members
 
Community Events
176
Community Groups

JIRA API to get roles by User

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

1 answer

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.

userApiresult.png

 

Thanks,

Loganayaki

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

Suggest an answer

Log in or Sign up to answer