Is there a way to see all the project roles a specific group has?

We have dozens of JIRA projects and groups. I'd like to be able to know for one group all the roles it's been given in all of the projects without going into each project to check.

Happy to have SQL query to answer this.

Thanks!

1 answer

SELECT pname as "PROJECT", PROJECTROLE.name as "ROLE", ROLETYPEPARAMETER as "GROUP"  FROM "PROJECTROLEACTOR"  JOIN PROJECTROLE on PROJECTROLE.id=PROJECTROLEACTOR.PROJECTROLEID JOIN project on project.id=PROJECTROLEACTOR.pid where roletype='atlassian-group-role-actor' and ROLETYPEPARAMETER='jira-users'

You have to change the ROLETYPEPARAMETER to the name of the group you're searching for.

What database are you running and what version of JIRA. I've tested the query agains 6.2

I've used that plugin to execute the query and it works - https://marketplace.atlassian.com/plugins/com.atlassian.sysadmin.homedirectorybrowser

My results:

jira=#  SELECT pname as "PROJECT", PROJECTROLE.name as "ROLE",
jira-# ROLETYPEPARAMETER as "GROUP"  FROM "PROJECTROLEACTOR"
jira-#  JOIN PROJECTROLE on PROJECTROLE.id=PROJECTROLEACTOR.PROJECTROLEID
jira-# JOIN project on project.id=PROJECTROLEACTOR.pid
jira-#  where roletype='atlassian-group-role-actor' and ROLETYPEPARAMETER='jira-users';
ERROR:  relation "PROJECTROLEACTOR" does not exist
LINE 2: ROLETYPEPARAMETER as "GROUP"  FROM "PROJECTROLEACTOR"

Did I take the query too literally?

Here's a query I've tested on postgresql and it works:

select * from projectroleactor
INNER join projectrole on (projectrole.id=projectroleactor.projectroleid)
INNER join project on (project.id=projectroleactor.pid)
where roletype='atlassian-group-role-actor' and projectroleactor.roletypeparameter='jira-users'

Shweet!! Thank you. I'm surprised the database structure would vary between mySQL and Postgresql. Or is it the format of the sql itself that had to change?

It is just the format of the sql, not the structure.

Much obliged. We will use this often!

We just upgraded to 6.3.7 from 6.2.7. Did something change? The above no longer works.

Boris, can you give me an updated select that works for 6.3.7?

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Posted 11 hours ago in Jira

We want to know what Jira Service Desk apps you're using!

Hi Community! My name is Amir and I’m on the Jira Service Desk product marketing team at Atlassian. Our team would love to understand how you’re leveraging our ecosystem for Jira Service Desk. Wha...

34 views 0 5
Join discussion

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