KACE Ticket Rule - works when "Run Now" but not "On Save"
I have a ticket rule designed to link a series of tickets as parents and children. The tickets are created by e-mails (which is why I am not using a process).
The tickets are created with a linking value in the CUSTOM_FIELD_VALUE14
The ticket rule is designed to look for tickets where the IS_PARENT flag = 0 and compare it to tickets where the IS_PARENT flag = 1, linked on the CUSTOM_FIELD_VALUE14 field. If there is a match, the PARENTID field of the "should be children" is to be updated with the ID for the "should be parent".
When I run it as "Run now" from within the ticket rule, it works properly (returns the correct records with the correct ID numbers updated)
When I run it as "On Save", the select returns the values I want, but the update
For example desired Parent ID = 35054 and the desired Child ticket is 35056. When I run it manually, it updates the "ParentID" field of 35056 with the value 35054, but when it is ran on As Save, it updates the ParentID field of 35056 with its own ID 35056.
This is the output of the select statement
User Termination - Assign Child Tickets | |||
New Rule | |||
# |
Id |
Parent Id |
Parentkaceid |
1 |
35056 |
0 |
35054 |
I believe that when the rule is run as an "on Save" there is something else appended to the end of the SQL statement, but I don't know exactly what, or how that would impact the updates.
Thanks!
*** Select statement
Select
HD_TICKET.ID,
HD_TICKET.PARENT_ID,
PARENT_HD_TICKET.ID As ParentKACEID
From
HD_TICKET Inner Join
HD_TICKET PARENT_HD_TICKET On HD_TICKET.CUSTOM_FIELD_VALUE14 =
PARENT_HD_TICKET.CUSTOM_FIELD_VALUE14
Where
HD_TICKET.HD_QUEUE_ID = 59 And
PARENT_HD_TICKET.HD_QUEUE_ID = 59 And
PARENT_HD_TICKET.IS_PARENT = 1 And
HD_TICKET.IS_PARENT = 0 And
HD_TICKET.PARENT_ID = 0
*** Update statement
update
HD_TICKET
Inner Join HD_TICKET PARENT_HD_TICKET On
HD_TICKET.CUSTOM_FIELD_VALUE0 = PARENT_HD_TICKET.CUSTOM_FIELD_VALUE0
set HD_TICKET.PARENT_ID = PARENT_HD_TICKET.ID
where
HD_TICKET.HD_QUEUE_ID = 59 And
HD_TICKET.IS_PARENT = 0 And
(HD_TICKET.ID in (<TICKET_IDS>))