/build/static/layout/Breadcrumb_cap_w.png

K1100 Service Desk: Randomly assign tickets to owners

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

Answers (2)

Posted by: chucksteel 8 years ago
Red Belt
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>)




Posted by: The_Real_Gary 8 years ago
White Belt
0
Thanks chucksteel, support actually got back to me about creating custom ticket rules and it's working now.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
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