JRS query to retrieve all projects in RTC which was inactive for past 16 months
Hi,
Accepted answer
Hi again,
If I have your criteria correct for what makes a project area obsolete, why wouldn't you just look for project areas where the # of work items updated in the past 16 months = 0? I am running 6.0.6 so have capabilities in JRS that you do not have. I was able to create this report without advanced SQL, but here is the SQL in case you're curious:
SELECT T1.PROJECT_NAME,
COUNT(DISTINCT CASE WHEN (MONTHS_BETWEEN(CAST(CURRENT_TIMESTAMP AS DATE), CAST(T1.REC_DATETIME AS DATE)) <= 16 ) AND (DAYS(CURRENT_TIMESTAMP) - DAYS(T1.REC_DATETIME) <= 0 ) THEN T1.REQUEST_ID END ) AS REC_DATETIME1
FROM RIDW.VW_REQUEST T1
WHERE T1.PROJECT_ID IN (<your project IDs here>)
AND
T1.ISSOFTDELETED = 0 AND
(T1.REQUEST_ID <> -1 AND T1.REQUEST_ID IS NOT NULL)GROUP BY T1.PROJECT_NAME
This returns the count for each project area of the number of work items (of any type) modified within the past 16 months. If the number is 0, the project area might be considered obsolete based on your rules -- which I am assuming at the moment.
Amy