Looking to find a way to know number and list of persons that did any action on tickets!
For example a ticket (From Submit to Close) has had 5 persons who did action on that ticket to be completed! (whether they are owner of ticket or just do action on that).
I was wondering if you could help me to find a way know number and list of persons who/which did any action on tickets.
It's for evaluation of departments to find load of works of each organization based on action which is done on tickets!
Thank you :)
Please log in to answer
Posted by: JasonEgg 2 years ago
SELECT T.ID AS TICKET_ID,
COUNT(DISTINCT USER.ID) AS 'Number of users',
GROUP_CONCAT(DISTINCT USER.USER_NAME) AS 'User names'
FROM HD_TICKET T
JOIN HD_TICKET_CHANGE C on C.HD_TICKET_ID = T.ID
JOIN USER ON USER.ID = C.USER_ID
WHERE T.TIME_CLOSED > SUBDATE(NOW(),INTERVAL 1 MONTH)
GROUP BY T.ID