Best Practices Question
Remove CC when CC is Ticket Owner
09/06/2017 539 views
New to the community and Kace. I hope this is in the right section....
I am curious to see if there is a trigger or something available to automatically remove a CC if the CC becomes the Ticket Owner? I may be thinking about this the wrong way, but our goal is to remove duplicate emails to the ticket owner.
Any assistance would be greatly appreciated.
Answer Chosen by the Author
Please log in to answer
Yes, this can be done using a custom ticket rules. Ticket rules have two main parts for something like this; a select statement which returns ticket IDs (or just one), and an update statement that acts on those IDs. There is a rules wizard but I don't think it would be very much help in this case. If you have experience with MySQL then I recommend enabling the reporting user on your appliance and connecting to the database with a tool like MySQL Workbench. Note that the KACE database is actually on MariaDB, but that doesn't tend to be an issue.
This select statement will return the appropriate tickets:
SELECT HD_TICKET.ID, SUBMITTER.EMAIL, HD_TICKET.CC_LIST
JOIN USER SUBMITTER on SUBMITTER.ID = HD_TICKET.SUBMITTER_ID
HD_TICKET.CC_LIST like concat("%", SUBMITTER.EMAIL, "%")
Since the CC_LIST may contain more than one email address the update statement needs to take that into account if you want to be careful. If you don't care then you can always just set the HD_TICKET.CC_LIST to "" and be done with it.
Answered 09/07/2017 by: chucksteel