How to retrieve groups which have roles in a project

How can I retrieve the groups which are allocated roles in a project.

i.e. Administrators = jira-administrators 

1 answer

0 votes
Micky CARITTE Community Champion Jan 18, 2018

Hi Daniel,

If I understand correctly you want an overview of groups usage in Roles overall?

That's not possible OOTB I'd say but with a few database query you might get that if you're familiar with SQL.

There might also be plugins able to help you, I've created one for group management which has a feature of showing group usage in projects but only for groups you belong to, it's called Group Ambassadors, there might be others (just checked but don't have enough time to deeply analyze).

If you need a free, quick solution you might go with SQL. I know Insight Asset Management plugin have an extension to graphically represent your instance configuration, that might be available there as well.

A lot of ideas, please let us know if any worked for you!


Thanks Micky, yes you're correct, I should have mentioned I was scripting in Groovy to try and retrieve this. 

It appears that my script currently does get "groups" but doesn't label that to be the case, it will show the content of users in each group, which do have a role, but not the group name. 

Thanks for the tip!

Micky CARITTE Community Champion Jan 18, 2018

In my plugin the java classes I,m using are mostly ProjectRoleManager and ProjectManager:

ProjectRoleManager prm = ComponentAccessor.getComponent(ProjectRoleManager.class);
ProjectManager pm = ComponentAccessor.getProjectManager();
for(Long pid : prm.getProjectIdsContainingRoleActorByNameAndType(group,ProjectRoleActor.GROUP_ROLE_ACTOR_TYPE)) {

The pid long var will give all project ids where the "group" parameter (A String containing a group name) have a role. 

You can then use ProjectRole class to identify the project role (in my case and it's not ideal I use:

List<ProjectRole> rids = new ArrayList(prm.getProjectRoles());
for(ProjectRole pr : rids) {
if(!prm.roleActorOfTypeExistsForProjects(pid,pr,ProjectRoleActor.GROUP_ROLE_ACTOR_TYPE,group).isEmpty()) {


 Hope this will help :)

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Wednesday in Jira

Make your Atlassian Cloud products more secure: our NEW admin security guide

Hey admins! I’m Dave, Principal Product Manager here at Atlassian working on our cloud platform and security products. Cloud security is a moving target. As you adopt more products, employees consta...

93 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you