Is there a way to configure the appliance to randomly assign tickets? Right now, it's defaulting to the DefaultTicketOwners as the owner of a ticket.I prefer it to assign to 2 admins of the appliance. I found something here:

UPDATE HD_TICKET, USER as T5
set HD_TICKET.OWNER_ID = T5.ID
WHERE 
(HD_TICKET.ID in (<TICKET_IDS>)) AND
T5.USER_NAME = 
CASE MOD(right((UNIX_TIMESTAMP(now())),1),2)+1 /*returns 1 or 2 based off timestamp*/
WHEN 1 THEN 'admin1' 
WHEN 2 THEN 'admin2'
ELSE 'admin2'
END

But when I run it, I get this:
mysqli error: [1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '<TICKET_IDS>)) AND T5.USER_NAME = CASE MOD(right((UNIX_TIMESTAMP(now())),1),2)+' at line 4] in EXECUTE("UPDATE HD_TICKET, USER as T5 set HD_TICKET.OWNER_ID = T5.ID WHERE (HD_TICKET.ID in (<TICKET_IDS>)) AND T5.USER_NAME = CASE MOD(right((UNIX_TIMESTAMP(now())),1),2)+1 /*returns 1 or 2 based off timestamp*/ WHEN 1 THEN 'admin1' WHEN 2 THEN 'admin2' ELSE 'admin2' END")

0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Answers

0
Here's how I would do it:
UPDATE HD_TICKET SET OWNER_ID = (SELECT ID FROM USER WHERE USER_NAME = (
SELECT 
CASE MOD(right((UNIX_TIMESTAMP(now())),1),2)+1 /*returns 1 or 2 based off timestamp*/
WHEN 1 THEN 'admin1' 
WHEN 2 THEN 'admin2'
ELSE 'admin2'
END))
WHERE HD_TICKET.ID in (<TICKET_IDS>)




Answered 04/18/2016 by: chucksteel
Red Belt

Please log in to comment
0
Thanks chucksteel, support actually got back to me about creating custom ticket rules and it's working now.
Answered 04/19/2016 by: The_Real_Gary
White Belt

Please log in to comment
Answer this question or Comment on this question for clarity

Share