Hey all, I have a problem. When a user submits a ticket I have a custom rule setup that emails them to confirm they submitted the ticket which works. But than three minutes later they get a email saying their ticket was updated with the "ticket opened" notes in it. This is stupid, they are getting this probably becuase I have comments checked for email notifications because I want our users to get ticket comment emails, but it makes no sense for them to get an email update because opening the ticket triggered a comment on the ticket. Can someone help me stop this madness!? LOL

Answer Summary:
Cancel
0 Comments   [ + ] Show Comments

Comments

  • This content is currently hidden from public view.
    Reason: Removed by member request
    For more information, visit our FAQ's.
Please log in to comment

Answers

1

Unfortunately the only way to stop this is to disable one of the two rules, either the custom rule or the canned event rule.  Or you can disable the canned event rule and create another custom rule for comments other than "ticket opened".

Answered 02/28/2014 by: grayematter
Fourth Degree Black Belt

  • Is there a way to code a custom ticket rule to have the system ignore the "Ticket Created" comment that is triggering the email update?

    Because I still need the ability to put comments in a ticket and selecting Owners Only for the comment not to be sent to the user for the IT documented work
    • To exclude the created record in the select query, you can add to the where clause something along the lines of
      HD_TICKET_CHANGE.DESCRIPTION not like 'TICKET CREATED%'
      • Where would I put such code though? Thanks for your help
      • Could you post the select query for your custom rule? For a sample that targets the Ticket Created, check http://www.itninja.com/question/email-ticket-owners-label-on-new-unassigned-ticket .
      • select HD_TICKET.ID,
        HD_TICKET.ID as TICKNUM,
        HD_TICKET.TITLE,
        U1.USER_NAME as OWNER_NAME,
        U3.USER_NAME as LASTINPUTNAME,
        DATE_FORMAT(HD_TICKET.CREATED,'%b %d %Y %I:%i:%s %p') as CREATED,
        DATE_FORMAT(HD_TICKET.MODIFIED,'%b %d %Y %I:%i:%s %p') as MODIFIED,
        HD_STATUS.NAME AS STATUS_NAME,
        HD_STATUS.ORDINAL as STATUS_ORDINAL,
        STATE,
        U1.FULL_NAME as OWNER_FULLNAME,
        U1.EMAIL as OWNER_EMAIL,
        U2.USER_NAME as SUBMITTER_NAME,
        U2.FULL_NAME as SUBMITTER_FULLNAME,
        U2.EMAIL as SUBMITTER_EMAIL,
        U3.EMAIL as UPDATEREMAIL,
        'email@email.com' as NEWTICKETEMAIL,
        UNIX_TIMESTAMP(HD_TICKET_CHANGE.TIMESTAMP),
        COMMENT
        from ( HD_TICKET,
        HD_PRIORITY,
        HD_STATUS,
        HD_IMPACT,
        HD_CATEGORY)
        JOIN HD_TICKET_CHANGE ON HD_TICKET_CHANGE.HD_TICKET_ID = HD_TICKET.ID
        and HD_TICKET_CHANGE.ID = '<CHANGE_ID>'
        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_CHANGE.USER_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.DESCRIPTION LIKE 'TICKET CREATED%'
      • In the last line of your code, you are catching all tickets on creation. Add "NOT" before "LIKE" to catch everything after the initial ticket creation.
      • Sorry, I'm a bit confused, that code I posted simply sends an email to the submitter that their ticket was successfully created. Adding that word of "Not" before like still sends the email that it was created and prevents the other notification from triggering that a the ticket was created?
      • You will need two rules, one to generate the "Ticket Created" email and a separate one to generate emails for subsequent changes.
      • So I turn off the built in comments for submitter and run the two rules?
      • Exactly. Turn off the email on event and enable both rules.
      • OK, we are getting somewhere. How do I "call" the comment into the email? I tried $change_desc but it just showed up as plain text in the email trigger. Also... is there a way to have the "owner only" stll work? When I selected owner only it still triggered the email to the submitter.
      • OK, I got the "Owners Only" option working so it won't trigger an email when owners only is checked by adding this code to my rule
        HD_TICKET_CHANGE.OWNERS_ONLY=0

        Now the only thing left is how do I get the comment in the email, lol.

        Thanks for all your help, we're almost there!
      • You are pulling the change comment with COMMENT in the fields selected. To reference this field in the email, use $comment.

        You could filter on the HD_TICKET_CHANGE.OWNERS_ONLY field to exclude any updates flagged as Owners Only. A 0 indicates "public" comment and a 1 indicates an owners only comment. The line in the where clause should be
        HD_TICKET_CHANGE.OWNERS_ONLY = 0
      • Thanks I got everything working! Except one thing now, lol. When I closed the ticket and inputted a resolution, it triggered a email with no comments. How can I tell it to ignore the " Added resolution text"
        and "Changed ticket Status from "Opened" to "Closed"" so those don't trigger emails either?
      • Ok, I got it so it won't send those emails either by adding more "Not Like" lines for status and resolution

        THANK YOU FOR YOUR HELP!
Please log in to comment
Answer this question or Comment on this question for clarity