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.
Since our last roundup in April, Atlassian's Marketplace Partners have added over 100 new cloud apps to the Atlassian Marketplace to help your teams work more efficiently. Let’s take a quick look a...
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