How to obtain a list of Primary Roles for each Resource
search cancel

How to obtain a list of Primary Roles for each Resource

book

Article ID: 429196

calendar_today

Updated On:

Products

Clarity PPM On Premise Clarity PPM SaaS Clarity FedRAMP

Issue/Introduction

I'd like to obtain a list of which "Primary Role" is associated with each Resource, what query can be used?

Environment

Clarity Any Release 

Resolution

The following query will provide the information:

SELECT

sr.full_name,

pj.prprimaryroleid,

role_ref.last_name AS primary_role_name

FROM

prj_resources pj

JOIN

srm_resources sr ON sr.id = pj.prid

LEFT JOIN

srm_resources role_ref ON pj.prprimaryroleid = role_ref.id

 

Within the results the first row will be the first and last name of the user. The second will contain the ID of the Primary Role, and the last column contains the name of the Primary Role

If the Resource has no Primary Role, the second two fields will be blank.