Automatically assign technician to child tickets produced from parent process
We currently have a process that creates a large amount of child tickets and we would like to automatically assign the same technician to the child tickets as are in the parent process. Any help or advice would be appreciated.
Answers (2)
You should create a custom ticket rule that copies the Assigned Owner ID from the parent down into the all the child tickets. In doing this I would also recommend that you use some kind of switch field so this only happens once, just in case you need to reassign the parent.
Your select would like something like this
SELECT
HD_TICKET.ID,
HD_TICKET.TITLE,
HD_TICKET.CUSTOM_FIELD_VALUE0,
HD_TICKET.HD_IMPACT_ID,
HD_TICKET.PARENT_ID,
HD_TICKET.OWNER_ID,
PARENT_TICKET.ID AS P_ID,
PARENT_TICKET.TITLE AS P_TITLE,
PARENT_TICKET.CUSTOM_FIELD_VALUE0 AS P_CUSTOM_FIELD_VALUE0,
PARENT_TICKET.HD_IMPACT_ID AS P_IMPACT,
PARENT_TICKET.IS_PARENT
FROM
HD_TICKET
LEFT JOIN HD_TICKET PARENT_TICKET ON HD_TICKET.PARENT_ID = PARENT_TICKET.ID
WHERE
HD_TICKET.PARENT_ID != "" AND HD_TICKET.HD_QUEUE_ID = 1 AND PARENT_TICKET.HD_STATUS_ID = 8
And the update something like
UPDATE
HD_TICKET
LEFT JOIN HD_TICKET PARENT_TICKET ON HD_TICKET.PARENT_ID = PARENT_TICKET.ID
SET
HD_TICKET.TITLE = PARENT_TICKET.TITLE,
HD_TICKET.OWNER_ID = PARENT_TICKET.OWNER_ID,
HD_TICKET.CUSTOM_FIELD_VALUE0 = PARENT_TICKET.CUSTOM_FIELD_VALUE0,
HD_TICKET.HD_IMPACT_ID = PARENT_TICKET.HD_IMPACT_ID
WHERE
HD_TICKET.ID in (<TICKET_IDS>)