How to find duplicate tickets and merge the information into one ticket
In this scenario I am creating tickets via email from an automated notification service (HP OpenView) that will send an email when an alert is created (i.e. issues with hardware on a system). Part of this process is to create a unique ID that is used to send updates when new notifications are created for the same system & problem. The unique ID is passed via the email to a custom field using the @ commands.
The issue is that when an update is send out via email, the service does not know the KACE ticket number and as such it is not included in the email. The unique ID is included in the email that is sent out, but since KACE does not know that this is an existing ticket it automatically creates a new ticket.
So my thought is to create a custom ticket rule that would look for other tickets with the same unqiue ID in the custom field and if it finds a match it copies what is in the comments of the updated ticket and enters it into the orginal ticket. Once this is done it would either close or delete the updated ticket.
The problem that I am having is that I can't seem to wrap my head around these two parts:
1. How would the select query work to find additional tickets with the same unique ID
2. How would I copy the comments from the newly created ticket to the orginal ticket
Community Chosen Answer
We were able to build out a solution to handle this via ticket rules. I will work on getting the ticket rules and what was completed on here for others to reference. What we ended up with was three ticket rules:
1. Ticket Rule that looks for other tickets with same unique value, and is open. If it finds one, it sets the "See Also" field to the ticket with the lowest (MIN) number.
2. Ticket Rule that looks for other tickets with same unique value , and is open. If it finds one, it creates a comment in the ticket that says it found a duplicate ticket and says the ticket will be closed.
3. Ticket Rule that looks for the comments entered in ticket rule 2. If found then it will set the status of the ticket to closed.
So this solution will allow the customer to send all notifications from HP OpenView to case, but will suppress updates to issues that already have a ticket open. We looked at copying the comments from the updated ticket to the primary ticket, but managed did not want this to be done for auditing reasons.