Custom rule help, move from one queue to another
I've got staff submitting things to general queue 16 right now and every time we want something to go into the IT queue we have to manually move it. It's silly. Hoping someone can provide some guidance on how to fix this query so that it works. Basically as long as it doesn't include the word "Facilities" in the title, I want to move it to queue 10. Here is what I have so far (lifted from another question here):
SELECT HD_TICKET.ID, HD_TICKET.TITLE,
JOIN HD_CATEGORY ON (HD_CATEGORY.ID = HD_TICKET.HD_CATEGORY_ID)
WHERE HD_TICKET.TITLE rlike 'Test'
AND HD_TICKET.HD_QUEUE_ID = 16
ORDER BY HD_TICKET.ID
UPDATE HD_TICKET, HD_CATEGORY
SET HD_TICKET.HD_QUEUE_ID = 10
WHERE HD_CATEGORY.ID = HD_TICKET.HD_CATEGORY_ID
AND HD_TICKET.ID = <TICKET_IDS>
I'm testing with anything in ticket title that says "Test". I'd love to keep the category from one queue to another if possible. Here is the fun error I get back:
29/07/2019 10:59:43> Starting: 29/07/2019 10:59:43 29/07/2019 10:59:43> Executing Select Query... 29/07/2019 10:59:43> selected 8 rows 29/07/2019 10:59:43> Executing Update Query... 29/07/2019 10:59:43> 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 '384,387,324,324,387,395,389' at line 4] in EXECUTE("UPDATE HD_TICKET SET HD_TICKET.HD_QUEUE_ID = 10 WHERE HD_CATEGORY.ID = HD_TICKET.HD_CATEGORY_ID AND HD_TICKET.ID = 327,384,387,324,324,387,395,389") 29/07/2019 10:59:43> Ending: 29/07/2019 10:59:43
Any insight appreciated :) I'm brutal with this stuff. Thx.