How can i create a custom rule to set ticket approver based on a selected category
Answers (2)
Top Answer
Hello,
first of all to keep the Update SQL simple you'd find out the ID of the user that you want to set as approver. (you can have a look in the USER table)
Then you can create with the Wizard a rule that acts on the tickets of the category that you like and sets, for now, a field that you choose (it's not important..we are going to customise the SQL Update in a bit)
Modify now the Update SQL with this code:
update HD_TICKET
set HD_TICKET.APPROVER_ID = 14
where HD_TICKET.ID in (<TICKET_IDS>)
change the APPROVER_ID to the USER.ID that wil need to approve.
Set the Schedule to on Ticket Save
Test it carefully before to go in production....rules are powerful and they need to be handled with care !
Kind regards,
Marco - StockTrader
update HD_TICKET, USER as T5
set HD_TICKET.APPROVER_ID = T5.ID
where T5.USER_NAME = 'approverusername' and
(HD_TICKET.ID in (<TICKET_IDS>))
Comments:
-
I did it and it worked, but how would set it so that the approval is required before open instead of close? - emorrison 8 years ago
-
After set HD_TICKET.APPROVER_ID = T5.ID add:
,HD_TICKET.APPROVE_STATE = "opened" - chucksteel 8 years ago