Hi,
Is there a way to list all customers that have access to a JSM project?
I could find the tables for developing a DB query that provides a list of of customers inside an organization who have access to a project.
SELECT p.pkey, au.lower_user_name AS "Customer", o."NAME" AS "Organization Name"
FROM project p
INNER JOIN "AO_54307E_ORGANIZATION_PROJECT" op ON p.id = op."PROJECT_ID"
INNER JOIN "AO_54307E_ORGANIZATION" o ON o."ID" = op."ORGANIZATION_ID"
INNER JOIN "AO_54307E_ORGANIZATION_MEMBER" om ON om."ORGANIZATION_ID" = o."ID"
INNER JOIN app_user au ON au.user_key = om."USER_KEY"
WHERE p.pkey = <pkey>
ORDER BY o."NAME";
Missing are still those customers who are not member of an organization but have direct access to the project.
I did only find a way to list the customers via project roles, but this is not working if the customers do not have any project role assigned.
SELECT p.pname, pr.NAME, u.display_name
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 = 'Service Desk Customers' AND p.pkey = <pkey>;
The best solution would be to extend the first query, to also match customers which are no member of an organization.
Thank you