Help Desk Question: Custom email rules.
Hello,
Currently any new ticket in the Help Desk created by email or the web interface is uncategorized and assigned to a user in the label named Unassigned, that users email address is a distribution group sent to the rest of us. So we all get the email and then can view the ticket and assign it to ourselves.
Is there a way we can set up the Kace box to assign the ticket to the first one who replies to the ticket?
Thanks,
Craig
Answers (3)
You can actually use some of the built in responses to change a ticket via email. It can be found in the help area "Managing Service Desk tickets"
Here's something you might play with, it's a ticket rule that pulls the last comment made on a ticket and the person (in an admin role) who made the comment, and then assigns that person as the owner of the ticket. I left the SELECT query a bit verbose, so you can see exactly what is being returned (via a SQL report or MySQL Query Browser) before you run it as a ticket rule.
These lines should effectively exclude the built-in admin user and non-admins:
1) Excludes all comments made by the system (ticket rules, etc):
WHERE HD_TICKET_CHANGE.USER_ID != 0
2) Excludes all blank comments:
AND HD_TICKET_CHANGE.COMMENT != ''
3) Limits Select query to first ticket queue:
AND HD_TICKET.HD_QUEUE_ID = 1
4) Limits selected users to those in admin roles (full admin = 1 and (in my queue) specialists = 6 - so you'll want to run this query first to determine what ID numbers to use:
SELECT U.USER_NAME, U.ROLE_ID
FROM USER U
ORDER BY U.USER_NAME
AND COMMENTER.ROLE_ID rlike '1|6'
5) Another filter on the built-in admin account (this time on the USER table)
AND COMMENTER.USER_NAME != 'admin'
Tested and this works fine here. Any questions, just let me know.
Hope that helps!
John
* An afterthought - I only tested this with admin accounts, so it's possible the WHERE statements will need to be in the subquery. If that turns out to be the case, just let me know and I'll revisit this.
________________________
X Run on ticket save
SELECT Query:
SELECT HD_TICKET_CHANGE.ID, HD_TICKET_CHANGE.COMMENT,
HD_TICKET_CHANGE.HD_TICKET_ID, HD_TICKET_CHANGE.USER_ID,
COMMENTER.USER_NAME AS COMMENTER, HD_TICKET.OWNER_ID,
OWNER.USER_NAME, HD_TICKET.ID
FROM
(SELECT HD_TICKET_CHANGE.HD_TICKET_ID,
MAX(HD_TICKET_CHANGE.ID) AS MAXID
FROM HD_TICKET_CHANGE
GROUP BY HD_TICKET_CHANGE.HD_TICKET_ID) V
JOIN HD_TICKET_CHANGE ON
(HD_TICKET_CHANGE.HD_TICKET_ID = V.HD_TICKET_ID
AND HD_TICKET_CHANGE.ID = V.MAXID)
JOIN HD_TICKET ON (HD_TICKET_CHANGE.HD_TICKET_ID = HD_TICKET.ID)
JOIN USER COMMENTER ON (COMMENTER.ID = HD_TICKET_CHANGE.USER_ID)
JOIN USER OWNER ON (OWNER.ID = HD_TICKET.OWNER_ID)
WHERE HD_TICKET_CHANGE.USER_ID != 0
AND HD_TICKET_CHANGE.COMMENT != ''
AND HD_TICKET.HD_QUEUE_ID = 1
AND COMMENTER.ROLE_ID rlike '1|6'
AND COMMENTER.USER_NAME != 'admin'
UPDATE Query:
UPDATE HD_TICKET, HD_TICKET_CHANGE
SET HD_TICKET.OWNER_ID = HD_TICKET_CHANGE.USER_ID
WHERE HD_TICKET_CHANGE.HD_TICKET_ID = HD_TICKET.ID
AND HD_TICKET.ID = <TICKET_IDS>