/build/static/layout/Breadcrumb_cap_w.png
03/29/2019 350 views

I have the following SQL syntax to send a notification when a new ticket is created:

select
  HD_TICKET.ID,
  HD_TICKET.ID ticket_number,                -- $ticket_number
  HD_TICKET.TITLE ticket_title,              -- $ticket_title
  SUBMITTER.FULL_NAME ticket_submitter_name, -- $ticket_submitter_name
  SUBMITTER.EMAIL ticket_submitter_email,    -- $ticket_submitter_email
  CAT.NAME ticket_category,                  -- $ticket_category
  IMPACT.NAME ticket_impact,                 -- $ticket_impact
  PRIORITY.NAME ticket_priority,             -- $ticket_priority
  STATUS.NAME ticket_status,                 -- $ticket_status
  group_concat(OWNERS.EMAIL) as EMAILCOLUMN
from
  HD_TICKET
  join HD_TICKET_CHANGE C on HD_TICKET.ID = C.HD_TICKET_ID
    and  C.ID = <CHANGE_ID>
  left join USER SUBMITTER on HD_TICKET.SUBMITTER_ID = SUBMITTER.ID
  left join HD_CATEGORY CAT on HD_TICKET.HD_CATEGORY_ID = CAT.ID
  left join HD_IMPACT IMPACT on HD_TICKET.HD_IMPACT_ID = IMPACT.ID
  left join HD_PRIORITY PRIORITY on HD_TICKET.HD_PRIORITY_ID = PRIORITY.ID
  left join HD_STATUS STATUS on HD_TICKET.HD_STATUS_ID = STATUS.ID
  join HD_QUEUE_OWNER_LABEL_JT HDQOLJT on HD_TICKET.HD_QUEUE_ID = HDQOLJT.HD_QUEUE_ID
  join USER_LABEL_JT ULJT on HDQOLJT.LABEL_ID = ULJT.LABEL_ID
  join USER OWNERS on ULJT.USER_ID = OWNERS.ID
where
  C.DESCRIPTION like '%Ticket Created%'


Which in turn creates the following notification:

A new ticket has been added to the IT Kace Service Desk.
Ticket number: $ticket_number
Title: $ticket_title
Submitter name: $ticket_submitter_name
Submitter email: $ticket_submitter_email
Impact: $ticket_impact
Priority: $ticket_priority
Status: $ticket_status
For complete details, see:
http://snskace02/adminui/ticket.php?ID=$ticket_number


Is there a way to define a variable for the body of an email so the above notification shows the body of the email?

Answer Summary:
0 Comments   [ + ] Show comments

Comments


Answer Chosen by the Author

0

you can get the body of an e-mail with the variable: $summary

HD_TICKET.Summary
Answered 04/01/2019 by: MGruber
Senior White Belt

  • This worked perfectly! Thank you!

All Answers

0

There are some built in variables, but many of them do not work in your custom rules but they do work in the Helpdesk Email Notifications settings.  To get to this section you would go to:

  1. Helpdesk
  2. Configuration
  3. Email Configuration
  4. Configure Help Desk Queue Email Settings
  5. Scroll down to Email On Events
  6. Click the [Customize Emails] link

In there you will find two things that may help you with this

  • Ticket Created from Email
  • Ticket Created From Portal

These templates allow you to make them look a little better and also allow for some variables like $ticket_history which will give you what you are looking for.



Answered 03/30/2019 by: JordanNolan
Seventh Degree Black Belt

  • Any insight on how to use the "$ticket_history" variable. And will this show the body of an email when a service request is sent to the help desk?
0

The variables available in custom ticket rules are determined by the columns selected in the SQL Select Statement. I'm not sure what you mean by "body of the email." Perhaps you are referring to the initial comment that generated the ticket? 

Answered 04/01/2019 by: chucksteel
Red Belt

  • Exactly. So when someone puts a service request in, we would like to be able to see what the issue is in the ticket that is generated by the service desk.