Hello, in our business we let users set their own priority for tickets. This of course leads to a large number of tickets being downgraded in priority. 

I would like to trigger an email when this happens, so that the user is sent an email explaining the rules for ticket priority.  So for example, lets say the user puts in an urgent ticket.  A HD person see's this urgent ticket is not actually urgent and lowers the priority.  The user receives an email that his ticket has been downgraded along with the little blurb of text we want to include.  

Any help would be appreciated. 
1 Comment   [ + ] Show Comment


  • Do you want the blurb to be specific to the type of change, e.g. from Urgent to Low, or would a generic message about priorities be sent? If you want the technician to be able to change the message then it gets more complicated.
    • We want it to be specific to the priority in that it only occurs when downgrading from Urgent. The message would be the same each time.

      Basically, users are abusing the urgent priority. We downgrade their urgent tickets to something else, which they then complain about through back channels. They say the issues are urgent and should remain as such.

      So this rule would trigger when a tickets priority is set from urgent to anything below urgent. It would ping the submitter saying "hey we reviewed your ticket and downgraded it as we don't believe it's urgent, if this is wrong, let us know".

      This would ideally only happen when downgrading from urgent though, if the ticket was set to normal, and downgraded no big deal. Though if kace can't handle something that specific, something that detected a downgrade in priority would work.
Please log in to comment


Create a new rule and use this as the SQL select statement:
                        HD_STATUS.NAME AS STATUS_NAME,
                        HD_STATUS.ORDINAL as STATUS_ORDINAL,
                        HD_IMPACT.ORDINAL as IMPACT_ORDINAL,
                        HD_CATEGORY.ORDINAL as CATEGORY_ORDINAL,
                        HD_PRIORITY.ORDINAL as PRIORITY_NUMBER,
                        if((datediff(DUE_DATE, now()) = 0), 2, if((datediff(DUE_DATE, now())<0), 1, 3)) as SORT_OVERDUE_STATUS,
                        if(unix_timestamp(TIME_OPENED) > 0, TIME_OPENED, 1<<62) as SORT_TIME_OPENED, 
                        if(unix_timestamp(TIME_STALLED) > 0, TIME_STALLED, 1<<62) as SORT_TIME_STALLED, 
                        if(unix_timestamp(TIME_CLOSED) > 0, TIME_CLOSED, 1<<62) as SORT_TIME_CLOSED, 
                        if(unix_timestamp(ESCALATED) > 0, ESCALATED, 1<<62) as SORT_ESCALATED,
                        if(unix_timestamp(HD_TICKET.CREATED) > 0, HD_TICKET.CREATED, 1<<62) as SORT_TIME_CREATED, 
                        if(unix_timestamp(HD_TICKET.MODIFIED) > 0, HD_TICKET.MODIFIED, 1<<62) as SORT_MODIFIED,
                        if(unix_timestamp(HD_TICKET.DUE_DATE) > 0, HD_TICKET.DUE_DATE, 1<<62) as SORT_DUE_DATE,
                        case upper(STATE) 
                        when 'CLOSED' then unix_timestamp(HD_TICKET.TIME_CLOSED) - unix_timestamp(HD_TICKET.TIME_OPENED) 
                        when 'OPENED' then unix_timestamp(NOW()) - unix_timestamp(HD_TICKET.TIME_OPENED) 
                        else unix_timestamp(NOW()) - unix_timestamp(HD_TICKET.CREATED) end as AGE,
                        if ((LENGTH(U1.FULL_NAME) = 0), U1.USER_NAME, U1.FULL_NAME) as OWNER_NAME,
                        U1.FULL_NAME as OWNER_FULLNAME,
                        U1.EMAIL as OWNER_EMAIL,
                        if (U1.ID is null, 'z', concat('a', if ((LENGTH(U1.FULL_NAME) = 0), U1.USER_NAME, U1.FULL_NAME))) as SORT_OWNER_NAME,
                        if ((LENGTH(U2.FULL_NAME) = 0), U2.USER_NAME, U2.FULL_NAME) as SUBMITTER_NAME,
                        U2.FULL_NAME as SUBMITTER_FULLNAME,
                        U2.EMAIL as SUBMITTER_EMAIL,
                        if (U2.ID is null, 'z', concat('a', if ((LENGTH(U2.FULL_NAME) = 0), U2.USER_NAME, U2.FULL_NAME))) as SORT_SUBMITTER_NAME,
                        if (U3.ID is null, 'z', concat('a', if ((LENGTH(U3.FULL_NAME) = 0), U3.USER_NAME, U3.FULL_NAME))) as SORT_APPROVER_NAME,
                        if(APPROVAL='rejected', 'Rejected', if(APPROVAL='info', 'More Info Needed', if(APPROVAL='approved', 'Approved', if(APPROVER_ID>0, 'Pending', '')))) as APPROVAL_STATUS,
                        Q.NAME as QUEUE_NAME                        
                        from (HD_TICKET, HD_PRIORITY, HD_STATUS, HD_IMPACT, HD_CATEGORY)
                        LEFT JOIN USER U1 on U1.ID = HD_TICKET.OWNER_ID
                        LEFT JOIN USER U2 on U2.ID = HD_TICKET.SUBMITTER_ID
                        LEFT JOIN USER U3 on U3.ID = HD_TICKET.APPROVER_ID
                        LEFT JOIN HD_QUEUE Q on Q.ID = HD_TICKET.HD_QUEUE_ID
                        LEFT JOIN MACHINE M1 on M1.ID = HD_TICKET.MACHINE_ID
                        where HD_PRIORITY.ID = HD_PRIORITY_ID
                        and HD_STATUS.ID = HD_STATUS_ID
                        and HD_IMPACT.ID = HD_IMPACT_ID
                        and HD_CATEGORY.ID = HD_CATEGORY_ID
                        and HD_TICKET_CHANGE_FIELD.BEFORE_VALUE = 'Urgent'

For column containing email address you can use SUBMITTER_EMAIL. Set the other settings appropriately and you should be good to go.

Answered 04/01/2016 by: chucksteel
Red Belt

  • This worked great.

    It looks like the only fancy bit is the use of the BEFORE_VALUE property?
    • Yes, joining to HD_TICKET_CHANGE_FIELD and looking at BEFORE_VALUE is the key here. If you want specific before and after values you can also use AFTER_VALUE.
Please log in to comment
Answer this question or Comment on this question for clarity