Report based on template name?
Hello,
I want to run report that shows how many times each offering has been used in the last x months. It doesn't work if I do a search int he portal because I have to search on Titles and titles of the requests get updated/changed and so aren't consistent.
Does anyone know of a way that I might be able to get this info?
Thanks in advance 😊
Best Answer
-
Justin_Workman Cireson Support Super IT Monkey ✭✭✭✭✭
@Tina_Sams - This query should help get you started:
SELECT
COUNT(*) AS 'Count',
t.DisplayName AS 'RequestOffering'
FROM Relationship r
JOIN BaseManagedEntity t
ON t.BaseManagedEntityId = r.TargetEntityId
WHERE r.RelationshipTypeId = '2730587f-3d88-a4e4-42d8-08cf94535a6e' --work item relates to Request Offering
GROUP BY t.DisplayName
ORDER BY Count DESC
5
Answers
@Tina_Sams - This query should help get you started:
SELECT
COUNT(*) AS 'Count',
t.DisplayName AS 'RequestOffering'
FROM Relationship r
JOIN BaseManagedEntity t
ON t.BaseManagedEntityId = r.TargetEntityId
WHERE r.RelationshipTypeId = '2730587f-3d88-a4e4-42d8-08cf94535a6e' --work item relates to Request Offering
GROUP BY t.DisplayName
ORDER BY Count DESC
Thanks @Justin_Workman I'll give it a go!