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

DI2E Licensing
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 9, 2014

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!

3 answers

2 votes
Boris Georgiev _Appfire_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 9, 2014
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.

Boris Georgiev _Appfire_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 9, 2014

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

DI2E Licensing
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 9, 2014

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?

DI2E Licensing
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 9, 2014

v6.2.1. Postgresql

DI2E Licensing
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 11, 2014

Any suggestions?

Boris Georgiev _Appfire_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 11, 2014

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'

DI2E Licensing
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 13, 2014

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?

Boris Georgiev _Appfire_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 13, 2014

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

DI2E Licensing
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 14, 2014

Much obliged. We will use this often!

DI2E Licensing
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 9, 2014

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

DI2E Licensing
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 14, 2014

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

0 votes
Kalen Brown June 14, 2018

A workaround would be to find a user that is part of that role, go to the View Project Roles and then Edit Project Roles for User and it will show if a group is mapping that user to a project role and will name the group.

Suggest an answer

Log in or Sign up to answer