Skip to main content

How do I use variables in snippets, messages and webhook actions? - Using Deskpro - Deskpro Support

How do I use variables in snippets, messages and webhook actions?

Authors list

These variables are available for use in snippets, as well as when sending a reply or SMS message with an automated action or using a web hook action. The variables are automatically replaced with the relevant value for the particular ticket.

 

NOTE: the variables used in email templates and portal templates are different from these. If you can't find the template variable you need by looking through the existing templates, please contact us at support@deskpro.com.

 

A typical simple use case is to start a message with

Dear Name

where 'Name' is the actual name of the user.

The format for a variable is:

{{ XXX }}

 

To start a message with the user's name:

 

Dear {{ ticket.person.display_name }} 

 

By using more variables and custom fields, you can build up a complicated personalised reply.

 

 

Ticket variables

{{ ticket.subject }}{{ ticket.department.title }}{{ ticket.product.title }}{{ ticket.category.title }}{{ ticket.workflow.title }}{{ ticket.priority.title }}{{ ticket.id }} {{ ticket.fieldN }} (for custom fields; replace N with the field ID) {{ ticket.ref }} {{ ticket.date_created }} (time and date ticket was created e.g. 2014-03-14 11:38:17)

 

 

User variables

 {{ ticket.person.display_name }} (user's name) {{ ticket.person.primary_email.email }} (user's email) {{ ticket.person.organization.name }} (user's organization) {{ ticket.person.organization_position }} (user's position in organization) {{ ticket.person.fieldN }} (for custom fields; replace N with the field ID)

 

Agent variables

{{ ticket.agent.display_name }}{{ ticket.agent.primary_email.email }}{{ ticket.agent_team.name }}

 

Helpful Unhelpful

47 of 74 people found this page helpful

Comments (4)

John DiNapoli
Does this represent all of the default objects available?
Ben Henley
This is most of the common variables. Please contact us if the variable you want is not here.
Harry Sheffield
Is it possible to create custom variables? I would like a variable that just pulls in the user's first name
Lauren Cumming
Hey Harry- you cannot create a custom variable to pull in the users first name sorry as DeskPRO uses a fullname format for users names at the moment.

Add a comment

Please log in or register to submit a comment.

Need a password reminder?