Copy info from Parent to Child rule suddenly stopped working
We have been using the below OTS ticket rule for quite sometime and then just last week it quit working. I run the rule in MySQL and it works but does not work in Kbox.
Here is the Select Query:
SELECT PARENT.CUSTOM_FIELD_VALUE1, HD_TICKET.CUSTOM_FIELD_VALUE1, PARENT.CUSTOM_FIELD_VALUE2, HD_TICKET.CUSTOM_FIELD_VALUE2,
PARENT.CUSTOM_FIELD_VALUE3, HD_TICKET.CUSTOM_FIELD_VALUE3,
PARENT.CUSTOM_FIELD_VALUE4, HD_TICKET.CUSTOM_FIELD_VALUE4,
PARENT.CUSTOM_FIELD_VALUE5, HD_TICKET.CUSTOM_FIELD_VALUE5,
PARENT.CUSTOM_FIELD_VALUE0, HD_TICKET.CUSTOM_FIELD_VALUE0, HD_TICKET.ID
FROM HD_TICKET PARENT, HD_TICKET
WHERE PARENT.ID = HD_TICKET.PARENT_ID
Here is the update query:
UPDATE HD_TICKET PARENT, HD_TICKET
SET
HD_TICKET.CUSTOM_FIELD_VALUE1 = PARENT.CUSTOM_FIELD_VALUE1,
HD_TICKET.CUSTOM_FIELD_VALUE2 = PARENT.CUSTOM_FIELD_VALUE2,
HD_TICKET.CUSTOM_FIELD_VALUE3 = PARENT.CUSTOM_FIELD_VALUE3,
HD_TICKET.CUSTOM_FIELD_VALUE4 = PARENT.CUSTOM_FIELD_VALUE4,
HD_TICKET.CUSTOM_FIELD_VALUE5 = PARENT.CUSTOM_FIELD_VALUE5,
HD_TICKET.CUSTOM_FIELD_VALUE6 = PARENT.CUSTOM_FIELD_VALUE6,
HD_TICKET.CUSTOM_FIELD_VALUE0 = PARENT.CUSTOM_FIELD_VALUE0,
WHERE ((PARENT.ID = HD_TICKET.PARENT_ID) AND HD_TICKET.ID = <TICKET_IDS>)
Any help would be appreciated.
0 Comments
[ + ] Show comments
Answers (1)
Please log in to answer
Posted by:
Mtcook
9 years ago
Here is what I am using. It is a direct copy and paste. I have more custom fields because this is from my New hire process.
Select SQL:
SELECT
PARENT.CUSTOM_FIELD_VALUE0,
HD_TICKET.TITLE,
HD_TICKET.ID
FROM
HD_TICKET PARENT, HD_TICKET
WHERE
PARENT.ID = HD_TICKET.PARENT_ID
AND HD_TICKET.RESOLUTION not like '%Fields Pulled From Parent Ticket%'
Update SQL:
HD_TICKET.CUSTOM_FIELD_VALUE0 = PARENT.CUSTOM_FIELD_VALUE0,
HD_TICKET.CUSTOM_FIELD_VALUE1 = PARENT.CUSTOM_FIELD_VALUE1,
HD_TICKET.CUSTOM_FIELD_VALUE2 = PARENT.CUSTOM_FIELD_VALUE2,
HD_TICKET.CUSTOM_FIELD_VALUE3 = PARENT.CUSTOM_FIELD_VALUE3,
HD_TICKET.CUSTOM_FIELD_VALUE4 = PARENT.CUSTOM_FIELD_VALUE4,
HD_TICKET.CUSTOM_FIELD_VALUE5 = PARENT.CUSTOM_FIELD_VALUE5,
HD_TICKET.RESOLUTION = CONCAT(HD_TICKET.RESOLUTION,' Fields Pulled From Parent Ticket.')
WHERE
((PARENT.ID = HD_TICKET.PARENT_ID) AND HD_TICKET.ID = <TICKET_IDS>)