Move a child ticket to a different queue
I am setting up a typical onboarding process and I will have a couple child tickets that I would like to send to a different queue, but I also want to be able for those tickets to inherit data from the parent ticket. From what I've read, and experienced in playing with this, is that a child ticket can't inherit the data from a parent if it is in a different queue. I currently have my child tickets inheritting the data, but they are in the same queue as the parent ticket. Once created with the inheritted information, is there a way to automatically move the child ticket to a different queue? I was hoping to do this in the Rules wizard, but there isn't the option to select the queue as the item to update. I'm thinking I could create a rule using SQL that runs every 15 minutes, but I'm not an SQL guy, I can mess around a figure a few things out, but I don't want to break anything.
<Edit> Do I need to create a duplicate queue with all the same fields as the original queue in order to be able to move it over, particularly if I'm using Templates, and then update the HD_TICKET.HD_QUEUE_ID, the HD_TICKET.HD_STATUS_ID, and the HD_TICKET.TICKET_TEMPOLATE_ID? Anything else to watch for when moving from one queue to another?
Answers (1)
Top Answer
I played around and I think figured it out. It seems that one of the keys that I read is to have a matching template in the queue that you want to move the ticket to. Once I set that up I was able to move a ticket from one queue to another. To do this, after recreating a matching template in the different queue, I updated the items I mention about in my edit HD_TICKET.HD_QUEUE_ID, the HD_TICKET.HD_STATUS_ID, and the HD_TICKET.TICKET_TEMPLATE_ID
I'm not a database guy by any means. It's a lot of trial and error for me, so you may be able to clean this up a little. I have the following:
- A queue called Staff Changes with and HD_QUEUE_ID = 3
- The HD_STATUS_ID, which starts off as New, which is an ID value of 9 for the Staff Changes queue.
- A TICKET_TEMPLATE_ID of 5 for a template in the Staff Changes queue called "Applications"
I want to move a ticket that gets generated as a child ticket with the above settings from a parent Staff Changes process into a seperate queue managed by our application team. I'll be changing the above items to the following:
- A queue called Enterprise Apps with a value of HD_QUEUE_ID=5
- I want to keep the status of New, and for the Enterprise Apps queue, the value of HD_STATUS_ID is 4 and not 9
- The matching template in the Enterprise Apps queue is TICKET_TEMPLATE_ID of 4
To move the ticket to the different queue after the ticket was auto-generated from the Staff Change process, I run the following in the Ticket Rules section:
Select Query
SELECT TITLE,HD_QUEUE_ID,HD_STATUS_ID
FROM `ORG1`.`HD_TICKET`
WHERE HD_TICKET.HD_QUEUE_ID = '3' ANDHD_TICKET.HD_STATUS_ID = '9' AND TICKET_TEMPLATE_ID = '5'
Update Query
UPDATE HD_TICKET
SET HD_TICKET.HD_QUEUE_ID='5',HD_TICKET.HD_STATUS_ID = '4', HD_TICKET.TICKET_TEMPLATE_ID = '4'
WHERE HD_QUEUE_ID = '3' AND HD_STATUS_ID= '9' AND TICKET_TEMPLATE_ID = '5'
There may be a cleaner way to do it, but this is working for me in the few tests I did. This allowed the information entered in the parent ticket to flow down into the child ticket that ultimately resides in a different queue, which was my original issue since you can't inherit information from the parent ticket if the child ticket is in a different queue. My next step will be figuring out how to run this script when a new child ticket is created, otherwise I'll just have to set it on a schedule.