/build/static/layout/Breadcrumb_cap_w.png
09/04/2019 114 views

Hello People,

Anyone know how to get a "new ticket" to send an email to a supervisor,

if it hasn't been opened by its "owner" for a specified amount of time ?

Is this done via a ticket rule? Not sure here?

Thanks guys

3 Comments   [ + ] Show comments

Comments

  • subscribing. we're looking into this same functionality.
    • Adding a comment won't send you updates. You need to click the Follow button.
  • Do you have supervisors (or managers) stored in the user data? If not, then will the supervisor be hard coded into the notification rule?
    • Yes @chucksteel.
      The supervisor in this case is the head of Department.
      Yes I have him in the list of users imported from LDAP.
      He is just another user with an email like everyone else.
      Does that make it easier?
      • What I meant is, when you look at the user detail for your technicians, is their Manager listed?
  • Hi there @chucksteel.
    The "manager" in the "user detail " was empty. But, yes... the head of IT is listen in the list of users in the drop down list. I can easily populate the field for all my technicians.
    And when I do that ..????
    • That is just a part of making the rule work. Otherwise you would need to hardcode the manager's email address into the rule. We have managers included in our Active Directory, so when we import via LDAP that field is set for us.


Community Chosen Answer

All Answers

0

This select statement should identify tickets with a status of "New" that have not been updated by their owner in the past four hours:

SELECT T.ID, T.TITLE, T.CREATED, LAST_CHANGE.TIMESTAMP, 
T.OWNER_ID,
OWNER.EMAIL,
MANAGER.EMAIL as MANAGER_EMAIL,
LAST_CHANGE.DESCRIPTION, 
T.TIME_CLOSED,
OWNER.*
FROM ORG1.HD_TICKET T
JOIN HD_TICKET_CHANGE LAST_CHANGE ON LAST_CHANGE.HD_TICKET_ID = T.ID
 and LAST_CHANGE.ID=(select MAX(ID) from HD_TICKET_CHANGE where HD_TICKET_CHANGE.HD_TICKET_ID = T.ID
and HD_TICKET_CHANGE.USER_ID = T.OWNER_ID)
left join HD_STATUS on HD_STATUS_ID = HD_STATUS.ID
left join USER OWNER on OWNER.ID = T.OWNER_ID
left join USER MANAGER on MANAGER.ID = OWNER.MANAGER_ID
WHERE 
OWNER.ID != 0
and HD_STATUS.NAME = 'New' 
and LAST_CHANGE.TIMESTAMP < NOW() - INTERVAL 4 HOUR

It includes a column for MANAGER_EMAIL which will be used for the Email each recipient in query results option. There are some other columns selected that can be used as variables in the email to be sent. 

You can change the interval by modifying the last line "INTERVAL 4 HOUR" (and yes, it is supposed to be singular for the unit).

Set the rule to run on a schedule and the manager will start receiving notifications. If you don't want the manager to receive multiple notifications for a ticket, then you will need to establish a way to know if the notice has already been sent, perhaps with a custom field that is updated.

Answered 09/09/2019 by: chucksteel
Red Belt

  • Thanks for the update .
    I will try it....