Can the update statement on a ticket rule be an insert?
Management would like to track small issues that are usually resolved quickly on first contact (like password resets). They would like me to set up a rule to insert a record into the HD_WORK table for all tickets in a specific queue to for 5 minutes of work. Is it even possible for the update statement box to contain a mysql insert statement?
Thanks.
0 Comments
[ + ] Show comments
Answers (2)
Please log in to answer
Posted by:
h2opolo25
9 years ago
You should not have to use insert for this.
use an update and set statement to set the HD_WORK.ADJUSTMENT_HOURS to 0.08 for the ticket.
(5min/60min = 0.083333)
Comments:
-
Scratch that. Just tested it and it won't work with the set statement. - h2opolo25 9 years ago
Posted by:
h2opolo25
9 years ago
Just tried the following in my test system and it worked.....(sorry for re-answer but comment formatting sucks)
select * from HD_TICKET
where HD_TICKET.ID = 394
INSERT INTO HD_WORK (HD_TICKET_ID, USER_ID, MODIFIED, ADJUSTMENT_HOURS)
VALUES(<TICKET_IDS>, 1444, NOW(), 0.23)
Make sure you include the USER_ID or else it will show in the table but won't show in the GUI, change your select and insert statements accordingly and most importantly do not blame me if it messes things up. TEST on a test VM before implementing anything in production.