How to identify which Groups have access to a Project in JIRA
You may run the following SQL query to find out the Users/Groups associated with Project Roles in a Project. I have modified the query to see which Groups are assigned to a Project role to which Project.
SELECT project.pkey as pkey,project.pname as project_name,projectrole.name as project_role_name,cwd_membership.parent_name as groupuser FROM cwd_membership,projectrole,projectroleactor,project WHERE project.id = projectroleactor.pid AND projectroleactor.projectroleid = projectrole.id AND (cwd_membership.parent_name = projectroleactor.roletypeparameter or cwd_membership.child_name = projectroleactor.roletypeparameter) AND roletype = 'atlassian-group-role-actor' AND membership_type='GROUP_USER' AND parent_name=roletypeparameter GROUP BY pkey,project_name,project_role_name,groupuser;
The above SQL query was written and tested only on PostgreSQL and MySQL databases, you may need to rewrite it accordingly to suit for other supported databases.