Question regarding ticket rule with multiple queue's
Hopefully this is an easy thing -- Basically, we've just created a second queue (various departments/levels), and I'm figuring out what is/isn't working in terms of ticket rules/scripts. I have a rule that, when a ticket is unassigned for over an hour, there is an email sent out to us in IT. Now, with the second queue, I copied the rule over because I want it working for both queues. All I changed was the email subject, basically letting me know if it was from queue1 or 2.
Probelm I had was that, in testing with one unassigned ticket in queue 1, I got both emails (ie, the same information, but the subject title was queue1 and queue2). I was curious if anyone knew what I had to change for this to send only a email if it's in the specific queue, not an overall thing. I assume is something simple, but this is my first change with double quques.
Code is below, thank you in advance!
HD_TICKET.ID AS TICKNUM, -- $ticknum
HD_TICKET.TITLE, -- $title
DATE_FORMAT(HD_TICKET.CREATED,'%b %d %Y %I:%i:%s %p') AS CREATED, -- $created
-- SUBMITTER.USER_NAME AS SUBMITTER_UNAME, -- $submitter_uname
SUBMITTER.FULL_NAME AS SUBMITTER_FNAME, -- $submitter_fname
-- SUBMITTER.EMAIL AS SUBMITTER_EMAIL, -- $submitter_email
S.NAME AS STATUS, -- $status
P.NAME AS PRIORITY, -- $priority
CAT.NAME AS CATEGORY, -- $category
'(company email redacted)' AS NEWTICKETEMAIL -- $newticketemail
/*status**********/ JOIN HD_STATUS S ON S.ID=HD_STATUS_ID
/* priority ******/ JOIN HD_PRIORITY P ON P.ID=HD_PRIORITY_ID
/* category ******/ JOIN HD_CATEGORY CAT ON CAT.ID=HD_CATEGORY_ID
/* submitter *****/ LEFT JOIN USER SUBMITTER ON SUBMITTER.ID = HD_TICKET.SUBMITTER_ID
WHERE TIMESTAMPDIFF(MINUTE,HD_TICKET.CREATED, NOW()) > 60 and S.NAME ='new' AND HOUR(NOW()) > 7 AND HOUR(NOW()) < 18
ORDER BY TICKNUM