/build/static/layout/Breadcrumb_cap_w.png

How can I setup a custom ticket rule that sends an email when a ticket is created with High/Critical Priority?

So I am trying to setup a custom ticket rule that will alert a team when a ticket is made with either high or critical priority that is assigned to their que. We are currently using a paging system that will do this alerting for us but the way we tell this paging system to send an alert is through an automated email to it. I have tried going through support and using the wizard but it just doesn't get me to what I am looking for. I can think through the logic but applying it to the actual syntax is proving to be a challenge. The concept is this: WHEN - Ticket is created with high or critical priority THEN IF - Owner/Assigned To = Team A Send Email to Team A Email ELSE IF - Owner/Assigned To = Team B Send Email to Team B Email ELSE IF - Owner/Assigned To = Team C Send Email to Team C Email ELSE Send Email to Team A Email Does anyone have an idea of how we can accomplish this? Or maybe there is a different way to do this that I'm not considering.

0 Comments   [ + ] Show comments

Answers (2)

Answer Summary:
Posted by: Hobbsy 2 years ago
Red Belt
0

Sure so if you have the id’s for all the analysts in team a, b or c, then you can create a Case statement to send an email to the correct team, simple right?

Not really as you can only send an email to a single address so you will need….

a group email address for each team

the email addresses for each team hidden in custom fields so you can call them into the rules as data variables and

probably a switch field so that the email is only sent once.

Simple ;o)

Posted by: barchetta 2 years ago
4th Degree Black Belt
0

Top Answer

So each of these teams is a queue?   Like team A is a queue?  If so you can build a list of owners to send to.  Just add a where statements which says if priority is critical.. No need for email lists, just use newticketemail as your email address in your rule. I too thought you could only have a single email address but somehow this works (I stole this from somewhere).  /* group email     */ is where the owners list is built.  I give my owners 15 minutes to take the ticket before I send. So in this example, if the ticket is critical and no owner is assigned in 15 minutes (or less, not more because I have a 45 minute rule as well) then the email is sent to all owners of the queue.  I set it to run every 15 minutes.. which means, in theory worst case, it might be 29 minutes.  


So if Im understanding you are assigning to a user account called team A.. no need to do this.   Sounds like maybe this was a workaround for your paging system?  I dunno.. not fully understanding.  Well, maybe this will help someone else if not you.


SELECT

      -- ticket fields

      HD_TICKET.ID, -- $id

      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

      DATE_FORMAT(HD_TICKET.MODIFIED,'%b %d %Y %I:%i:%s %p') AS MODIFIED, -- $modified

      -- change fields

      C.COMMENT, -- $comment

      C.DESCRIPTION, -- $description


      -- about the owner

      OWNER.USER_NAME AS OWNER_UNAME, -- $owner_uname

      OWNER.FULL_NAME AS OWNER_FNAME, -- $owner_fname

      OWNER.EMAIL AS OWNER_EMAIL,     -- $owner_email

      IFNULL(OWNER.USER_NAME,'Unassigned') OWNER_USER, -- $owner_user

      -- about the submitter

      SUBMITTER.USER_NAME AS SUBMITTER_UNAME, -- $submitter_uname

      SUBMITTER.FULL_NAME AS SUBMITTER_FNAME, -- $submitter_fname

      SUBMITTER.EMAIL AS SUBMITTER_EMAIL,     -- $submitter_email

    

      P.NAME AS PRIORITY, -- $priority

      S.NAME AS STATUS,   -- $status

      I.NAME AS IMPACT,   -- $impact

      CAT.NAME AS CATEGORY, -- $category


      -- -- Assign Email

OLIST.EMAIL AS NEWTICKETEMAIL -- $newticketemail


FROM 

HD_TICKET

     /* latest change ***/ 

JOIN HD_TICKET_CHANGE C ON C.HD_TICKET_ID = HD_TICKET.ID AND C.ID=<CHANGE_ID>

     /* complete history*/ JOIN HD_TICKET_CHANGE H ON H.HD_TICKET_ID = HD_TICKET.ID

     /* priority ********/ JOIN HD_PRIORITY P ON P.ID=HD_PRIORITY_ID

     /* status **********/ JOIN HD_STATUS S ON S.ID=HD_STATUS_ID

     /* impact-severity */ JOIN HD_IMPACT I ON I.ID=HD_IMPACT_ID

     /* category ********/ JOIN HD_CATEGORY CAT ON CAT.ID=HD_CATEGORY_ID

     /* owner ***********/ LEFT JOIN USER OWNER ON OWNER.ID = HD_TICKET.OWNER_ID

     /* submitter *******/ LEFT JOIN USER SUBMITTER ON SUBMITTER.ID = HD_TICKET.SUBMITTER_ID

     /* updater *********/ LEFT JOIN USER UPDATER ON UPDATER.ID = C.USER_ID


 /* group email     */

JOIN HD_QUEUE_OWNER_LABEL_JT ON HD_TICKET.HD_QUEUE_ID = HD_QUEUE_OWNER_LABEL_JT.HD_QUEUE_ID

JOIN USER_LABEL_JT ON HD_QUEUE_OWNER_LABEL_JT.LABEL_ID = USER_LABEL_JT.LABEL_ID

JOIN USER OLIST ON USER_LABEL_JT.USER_ID = OLIST.ID


/* queue */

JOIN HD_QUEUE ON HD_TICKET.HD_QUEUE_ID = HD_QUEUE.ID

where   /* SET CORRECT QUEUE ID(S) HERE! */ HD_TICKET.HD_QUEUE_ID in (1)   and P.NAME = 'Critical'     and HD_TICKET.OWNER_ID = '0'   and HD_TICKET.CREATED < SUBDATE(NOW(), INTERVAL 15 MINUTE) 
 
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