/build/static/layout/Breadcrumb_cap_w.png

custom ticket rule variables

I am trying to get some variables working in a custom ticket rule (variables in custom ticket rule seem to be different than e-mail template variables).

I have the following cariables and all of them are working great except for the Ticket URL:


Created:    $created
Ticket ID:    $id
ticket URL: $ticket_url
Issue:        $title
Submitter:    $submitter_name



I have also tried $url but also didn't work..... Does anyone know where I can find the correct syntax for custom ticket rules?


Thanks


1 Comment   [ + ] Show comment
  • Excellent idea... Thanks - raul102801 9 years ago

Answers (2)

Answer Summary:
Posted by: Hobbsy 9 years ago
Red Belt
1

Top Answer

We have found in the past that it is easier to make up the URL from plain text and then add the ticket ID variable to the end to finish the URL.

From within a service desk ticket if you click the Choose Action menu and select Email Ticket as an option, enter your email into the popup window and wait to receive the email.

In the email you will see the full URL for the ticket eg

https://k1000.indigomountain.co.uk/userui/ticket?ID=235

So in your email template you can use the following

Created:    $created
Ticket ID:    $id
ticket URL: https://k1000.indigomountain.co.uk/userui/ticket?ID=$id
Issue:        $title 
Submitter:    $submitter_name


Posted by: chucksteel 9 years ago
Red Belt
0
The variables available for custom rules are determined by the fields selected in the select statement. Any columns returned will be available as $column_name in the email template. 

Comments:
  • Hey, is this still true???

    I am trying to use code like this:
    select
    distinct HD_TICKET.ID,
    HD_TICKET.CUSTOM_FIELD_VALUE1 AS USERNAME, -- $USERNAME
    HD_TICKET.CUSTOM_FIELD_VALUE2 AS PASSWORD, -- $PASSWORD
    HD_TICKET.CUSTOM_FIELD_VALUE3 AS EMAIL, -- $EMAIL
    HD_TICKET.CUSTOM_FIELD_VALUE4 AS PHONE, -- $PHONE
    HD_TICKET.RESOLUTION AS RESOLUTION,
    case
    when HD_TICKET.SUMMARY like "%Company: some-company1%" then "some-company1@somewhere.com"
    when HD_TICKET.SUMMARY like "%Company: some-company2%" then "some-company2@somewhere.com"
    when HD_TICKET.SUMMARY like "%Company: some-company3%" then "some-company3@somewhere.com"
    when HD_TICKET.SUMMARY like "%Company: some-company4%" then "some-company4@somewhere.com"
    when HD_TICKET.SUMMARY like "%Company: some-company5%" then "some-company5@somewhere.com"
    else "someone@somewhere.com"
    end as NEWTICKETEMAIL -- $newticketemail
    from
    HD_TICKET
    join HD_TICKET_CHANGE c on HD_TICKET.ID = c.HD_TICKET_ID and c.ID = <CHANGE_ID>
    left join HD_TICKET_CHANGE_FIELD cf on c.ID = cf.HD_TICKET_CHANGE_ID
    join HD_STATUS S on HD_TICKET.HD_STATUS_ID = S.ID
    join HD_SERVICE_TICKET st on HD_TICKET.SERVICE_TICKET_ID = st.ID
    join HD_SERVICE serv on st.HD_SERVICE_ID = serv.ID
    ,(select S.`VALUE` ticket_label from SETTINGS S where S.`NAME` = "HD_TICKET_LABEL") settings
    where

    # HD_TICKET.PARENT_ID = 0 and HD_TICKET.IS_PARENT # Parent Ticket
    HD_TICKET.PARENT_ID > 0 and !HD_TICKET.IS_PARENT # Child Ticket
    and HD_TICKET.TITLE like "User Accounts%" # title starts with "User Accounts"

    and serv.NAME = "Main Employee Process" # of process "Main Employee Process"
    and S.STATE = "closed" # on ticket close...
    and (
    c.DESCRIPTION like concat("%", settings.ticket_label, " Created%")
    or ifnull(cf.FIELD_CHANGED, "") = "STATUS_NAME"
    ) # ...on ticket close
    group by
    HD_TICKET.ID


    and when using these variables in the E-mail that gets sent out:

    $USERNAME
    $PASSWORD
    $EMAIL
    $PHONE

    $Resolution

    $CUSTOM_FIELD_VALUE1
    $CUSTOM_FIELD_VALUE2
    $CUSTOM_FIELD_VALUE3
    $CUSTOM_FIELD_VALUE4



    The e-mail just displays:
    $USERNAME
    $PASSWORD
    $EMAIL
    $PHONE

    $Resolution

    $CUSTOM_FIELD_VALUE1
    $CUSTOM_FIELD_VALUE2
    $CUSTOM_FIELD_VALUE3
    $CUSTOM_FIELD_VALUE4


    Any info on what I am doing wrong would be much appreciated!

    Jason - jct134 3 years ago
    • Variables should be all lower case. - chucksteel 3 years ago
      • Much appreciated. - jct134 3 years ago

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
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