Query to get all projects using certain groups

PaulaA December 18, 2018

Hi, 

I need to find the way to get all projects where a certain group is used . Any ideas? I don't see the link in the database for this

Thanks

3 answers

1 accepted

0 votes
Ankush Kumar January 6, 2022

Hi @PaulaA 

I have a same requirement. Can you please help me with the script. If you have already resolved this.

0 votes
Marc Minten _EVS_
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.
December 18, 2018

Hi,

I guess you mean User groups used in Project roles ?

In that case, this db query might help:

SELECT distinct p.pname, p.ID projectid, a.PROJECTROLEID roleid, a.ROLETYPEPARAMETER
FROM dbo.projectroleactor a
    join dbo.project p on a.pid=p.id
WHERE roletype like '%group%'
ORDER BY p.pname, a.ROLETYPEPARAMETER
PaulaA December 18, 2018

Hi

Thanks.

I have the following query:

SELECT p.pname, p.PKEY, p.LEAD, pr.NAME, u.user_name, u.display_name, u.email_address
FROM projectroleactor pra
INNER JOIN projectrole pr ON pr.ID = pra.PROJECTROLEID
INNER JOIN project p ON p.ID = pra.PID
INNER JOIN app_user au ON au.lower_user_name = pra.ROLETYPEPARAMETER
INNER JOIN cwd_user u ON u.user_name = au.user_key
WHERE pr.NAME = 'Administrators' and u.active=1
ORDER BY p.pname;

this gives me all administrators for the projects that I have but I still need to filter and get only the projects where certain user groups are used.

The idea is that the administrators that are using certain groups will receive an email

David WS Ingty
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 20, 2020

SELECT p.pname as project_name, p.pkey, pr.NAME as project_role, u.display_name as user_displayName, u.lower_email_address as email_address
FROM projectroleactor pra
INNER JOIN projectrole pr ON pr.ID = pra.PROJECTROLEID
INNER JOIN project p ON p.ID = pra.PID
INNER JOIN app_user au ON au.user_key = pra.ROLETYPEPARAMETER
INNER JOIN cwd_user u ON u.lower_user_name = au.lower_user_name

Like Swati Gupta likes this

Suggest an answer

Log in or Sign up to answer