K1000 - Report to show when a ticket has been reassigned to a new owner
Answers (2)
I don't think that kind of filtering is available in the wizard. The query below should get you started.
SELECT
*
FROM
HD_TICKET
JOIN
ORG1.HD_TICKET_CHANGE ON HD_TICKET.ID = HD_TICKET_CHANGE.HD_TICKET_ID
WHERE
HD_TICKET_CHANGE.DESCRIPTION LIKE '%Changed ticket Owner from%'
AND HD_TICKET_CHANGE.TIMESTAMP > DATE_SUB(NOW(), INTERVAL 30 DAY)
ORDER BY HD_TICKET_CHANGE.TIMESTAMP DESC;
That will capture all assignment changes, including the initial assignment. If you want to exclude the initial assignment, try this query instead.
SELECT
*
FROM
HD_TICKET
JOIN
ORG1.HD_TICKET_CHANGE ON HD_TICKET.ID = HD_TICKET_CHANGE.HD_TICKET_ID
WHERE
(HD_TICKET_CHANGE.DESCRIPTION LIKE '%Changed ticket Owner from%'
AND HD_TICKET_CHANGE.DESCRIPTION NOT LIKE '%Changed ticket Owner from "Unassigned" to%')
AND HD_TICKET_CHANGE.TIMESTAMP > DATE_SUB(NOW(), INTERVAL 30 DAY)
ORDER BY HD_TICKET_CHANGE.TIMESTAMP DESC;
Comments:
-
Good morning, I was searching and came across this post, which is something I would love to be able to report on (When a user changes ticket owner to another user - I suspect someone is changing ticket ownership after it is closed to buff stats). The problem is when I run the query above I get
mysqli error: [1142: SELECT command denied to user 'R4'@'localhost' for table 'HD_TICKET_CHANGE'] in EXECUTE( "SELECT * FROM HD_TICKET JOIN ORG1.HD_TICKET_CHANGE ON HD_TICKET.ID = HD_TICKET_CHANGE.HD_TICKET_ID WHERE HD_TICKET_CHANGE.DESCRIPTION LIKE '%Changed ticket Owner from%' AND HD_TICKET_CHANGE.TIMESTAMP > DATE_SUB(NOW(), INTERVAL 30 DAY) ORDER BY HD_TICKET_CHANGE.TIMESTAMP DESC LIMIT 0")
I'm an admin user so I should have the permissions to do this query, I suspect maybe it's syntax but I'm not sure. - cr8zyeddie 2 years ago
Based on the error - SELECT command denied to user 'R4'@'localhost' - the R4 user may not have permissions. Try a simple "select * from HD_Ticket;" then "select * from HD_TICKET_CHANGE;". If both of those are successful, the account should have the correct permissions.
Also, in my instance, everything is under ORG1 as we only have a single organization configured. Things may be under a different schema in your instance, especially if you have multiple organizations configured.
Comments:
-
Thank you! It was the ORG1 causing the issue as we do have multiple organizations. After changing that the query worked. Thanks again! - cr8zyeddie 2 years ago