/build/static/layout/Breadcrumb_cap_w.png

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>))


0 Comments   [ + ] Show comments

Answers (2)

Answer Summary:
Posted by: chucksteel 8 years ago
Red Belt
0

Top Answer

When rules run on save I believe that KACE appends a "AND HD_TICKET.ID = <TICKET ID BEING SAVED>", but I'm not positive.
Posted by: VSwift 8 years ago
Senior Yellow Belt
0

Ah - ok.  I removed the  (HD_TICKET.ID in (<TICKET_IDS>)) from the update SQL and repeated all the select logic and it now works fine :-)

Your answer pointed me in the right direction  thanks

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ