K1000 Service Desk: How to select user label in ticket rule
I have ticket rules that email a supervisor if a ticket sits in "New" or "Follow-up" status for a specified period of time. I want to create another rule that is identical except it emails a different supervisor if his employees have tickets in "New" or "Follow-up" status for the same perios of time. In other words, we have two Departments (networking and technicians) that want the same notification rules. I created user labels to distinguish between the two departments, but don't know how to select that label in the ticket rule. We don't want separate queues for these departments, because of our size (small).
Any ideas on either how to write a ticket rule that includes sorting ticket owners by user label or a better way to do what I want?
Here's an example of the current query based only on status and time, not differentiating between owners:
Select 'email@example.com' AS CHARLIE,
S.NAME AS STATUS, T.ID AS ID, T.TITLE AS ISSUE,
U.FULL_NAME AS SUBMITTER, O.FULL_NAME AS OWNER,
T.CREATED AS CREATED, T.MODIFIED AS STALLED
FROM HD_TICKET T
JOIN HD_STATUS S ON (S.ID = T.HD_STATUS_ID)
JOIN USER U ON (U.ID = T.SUBMITTER_ID)
JOIN USER O ON (O.ID = T.OWNER_ID)
WHERE (S.NAME = 'New' AND DATEDIFF(NOW(), T.MODIFIED) >= 7)
AND T.HD_QUEUE_ID = 1