Report of Ticket Ownership Escalations by Owner
SELECT USER_NAME,
COUNT(USER_ID) as TOTAL
FROM `ORG1`.`HD_TICKET_CHANGE`
LEFT JOIN USER UPDATER ON UPDATER.ID = USER_ID
LEFT JOIN HD_TICKET OTICK ON OTICK.ID = HD_TICKET_ID
WHERE USER_ID != 0
AND DESCRIPTION LIKE '%Changed ticket Owner from "%'
AND DESCRIPTION NOT LIKE '%Changed ticket Queue from "%'
AND OTICK.HD_QUEUE_ID = 1 /*1 is the default queue...*/
AND ((TIMESTAMP(TIMESTAMP) <= NOW() AND TIMESTAMP(TIMESTAMP) > DATE_SUB(NOW(),INTERVAL 1 MONTH))) /*can change interval*/
AND USER_NAME NOT LIKE '%ADD FILTERS FOR ERRONEOUS RESULTS%'
GROUP BY USER_ID ORDER BY TOTAL DESC LIMIT 30;
Comments