I would like to get hold of the roles a user is in within a groovy script
Has anyone done this? The equivalent of the Show User Roles action on the administer user page.
I've looked through the API's for ProjectRoleService and ProjectRoleManager but I'm not seeing a way to get what I want back.
If you want to do this you propably need something like this:
String username = "username"
ApplicationUser user = ComponentAccessor.getUserManager().getUserByName(username)
String prjkey = "projectkey"
Project project = ComponentAccessor.getProjectManager().getProjectByCurrentKey(prjkey)
ProjectRoleManager prjrolemgr = ComponentAccessor.getComponent(ProjectRoleManager)
Collection<ProjectRole>prjroles = prjrolemgr.
Happy New Year, everybody! What better way to kick off 2022 than with a new Marketplace Partner Spotlight ✨ This month, we're getting to know Daniel Franz, co-founder of Fine Software. Fine Software ...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events