Looking for KACE sql query to update ticket title
Hello, I'm looking for help writing a rule to update the ticket title from information from within the ticket. I'm able to get it to update by using only one custom field however having issue when adding the other two in the mix.
Any help would be appreciated.
Current query is:
update HD_TICKET
set HD_TICKET.TITLE = HD_TICKET.CUSTOM_FIELD_VALUE4, HD_TICKET.CUSTOM_FIELD_VALUE5, HD_TICKET.CUSTOM_FIELD_VALUE7
where
(HD_TICKET.ID in (<TICKET_IDS>))
0 Comments
[ + ] Show comments
Answers (1)
Answer Summary:
Please log in to answer
Posted by:
chucksteel
7 years ago
Top Answer
You need to concatenate the fields together:
update HD_TICKET
set HD_TICKET.TITLE = concat(HD_TICKET.CUSTOM_FIELD_VALUE4, HD_TICKET.CUSTOM_FIELD_VALUE5, HD_TICKET.CUSTOM_FIELD_VALUE7)
where
(HD_TICKET.ID in (<TICKET_IDS>))
You can add additional formatting if needed, e.g. a dash between field 4 and field 5:
update HD_TICKET
set HD_TICKET.TITLE = concat(HD_TICKET.CUSTOM_FIELD_VALUE4, " - ", HD_TICKET.CUSTOM_FIELD_VALUE5, HD_TICKET.CUSTOM_FIELD_VALUE7)
where
(HD_TICKET.ID in (<TICKET_IDS>))
Comments:
-
Excellent!! Worked! Thanks! - createsimple 7 years ago