Zendesk Support placeholders are containers for dynamically generated ticket and user data. The format is a data reference contained within double curly brackets. Since you can also access ticket and user data when defining programming logic, it may be helpful to think beyond placeholders and think instead of data objects and their properties that can be used for either purpose.
There are two primary data objects in Zendesk Support: Ticket and User. Each has its own set of properties; the User object, for example, contains user properties such as name and email. In addition to these two data objects, there are associated data objects. For tickets, there are the Comment and Satisfaction Rating objects. For users, there are the Organization and Agent objects.
Although placeholders can be in HTML format, when a placeholder is sent to a HTTP or URL target, Markdown is used to render the placeholder, not HTML.
Support includes inborn system rules that suppress placeholders in triggers in certain situations. Inborn system rules are rules that you cannot change, modify, or override, which dictate the default behavior of Support. These rules may sometimes make it seem like placeholders in triggers failed to work, but this isn’t a mistake. These rules protect you because they prevent spammers from using your account to distribute spam messages. For more information, see Understanding placeholder suppression rules.
This article categorizes the placeholders by the data they display:
Related articles:
User data
- ticket.requester, who is the person who requested the ticket
- ticket.assignee, who is the agent assigned to the ticket
- ticket.submitter, who is either the user who submitted the request or the agent that opened the ticket on behalf of the requester
- current_user, who is the user currently updating the ticket (an end-user or agent)
This means that most of the user data listed in the following table can be returned for each type of user (for example, {{ticket.submitter.name}}, {{current_user.name}}, and so on).
Properties/placeholders | Description |
---|---|
user.name
Important: Remember to replace user with one of the user types shown above (for example, ticket.requester).
|
The user's full name. |
user.first_name | The user's first name. |
user.last_name | The user's last name. |
user.email | The user's email address. |
user.language | The user's language preference. |
user.phone | The user's telephone number. |
user.external_id | The user's external ID (if one exists). Optional for accounts that have enabled enterprise single sign-on using JWT or SAML. |
user.details | The user's details. |
user.notes | The user's notes. |
user.time_zone | The user's time zone. |
user.role | The user's role (Admin, Agent, or End-user). |
user.extended_role | When using Support Enterprise agent roles, this returns the name of the agent's Enterprise role. These are the predefined roles:
If you've created custom agent roles, those role names are returned. If you're not an Enterprise account, using this placeholder returns 'Agent' for all agent users. End-users are 'End-user'. For more information about custom agent roles, see Custom agent roles. |
user.id | The user's ID. |
user.locale | The user's locale (for example: en-US). |
user.signature | The agent's signature. Only agents have signatures. |
user.organization... | See Organization data below. |
user.tags | Tags. See Adding tags to users and organizations. |
Organization data
Each type of user can be added to an organization. An organization contains the following data properties.
Properties/placeholders | Description |
---|---|
user.organization.id
Important: Remember to replace user with one of the user types shown below.
|
The ID of the organization that the user is assigned to. |
user.organization.name | The name of the organization that the user is assigned to. |
user.organization.is_shared | True or False. Indicates if the organization is a shared organization. |
user.organization.is_shared_comments | True or False. Indicates if the organization allows users to add comments to other user's tickets. |
user.organization.details | Details about the organization. |
user.organization.notes | Notes about the organization. |
user.organization.tags | Tags. See Adding tags to users and organizations. |
- {{ticket.organization.name}}, which is the ticket requester's organization
- {{ticket.requester.organization.name}}, which the same as {{ticket.organization.name}} (the requester)
- {{current_user.organization.name}}, who is the user currently updating the ticket (an end-user or agent)
- {{ticket.assignee.organization.name}}, who is the agent assigned to the ticket
- {{ticket.submitter.organization.name}}, who is either the user who submitted the request or the agent that opened the ticket on behalf of the requester
Agent data
You can use the following placeholders in agent signatures only. For information on agent signatures, see Adding an agent signature to ticket email notifications.
Properties/placeholders | Description |
---|---|
agent.name | The agent's full name (or alias, if present). |
agent.first_name | The agent's first name. |
agent.last_name | The agent's last name. |
agent.role | The agent's role. |
agent.signature | The agent's signature. |
agent.email | The agent's email address. |
agent.phone | The agent's phone number. |
agent.organization | The agent's organization. |
agent.language | The agent's language. |
agent.time_zone | The agent's time zone. |
Ticket data
Zendesk Support tickets contain the following data properties.
Properties/placeholders | Description |
---|---|
ticket.account | The Zendesk account name. |
ticket.assignee.name | Ticket assignee full name (if any). See User data above. |
ticket.brand.name | The ticket's assigned brand name. |
ticket.cc_names | Returns the names CCs on the ticket.
Note: If you are using the new CCs and followers experience and you are adding or updating your placeholders, we recommend using
ticket.email_cc_names instead of tickets.cc_names . They do the same thing.If you want to return the email addresses of the people CC'd on the message, you can use this Liquid code:
|
ticket.email_cc_names |
With the new CCs and followers experience, returns the names of CCs on the ticket. With the old CCs experience, returns empty. Note: If you are using the new CCs and follower experience and you are adding or updating your placeholders, we recommend using
ticket.email_cc_names instead of tickets.cc_names . They do the same thing. |
ticket.follower_names | With the new CCs and followers experience, returns the names of followers. With the old CCs experience, returns empty. |
ticket.follower_reply_type_message | With the new CCs and followers experience, indicates what type of comment (public or private) triggered the notification. With the old CCs experience, returns empty. |
ticket.created_at | Date the ticket was created (for example, May 18, 2014).
Note: The year is not included if the ticket was created in the current year.
|
ticket.created_at_with_timestamp | Time the ticket was created expressed as an iso8601 format date/time. Example: 2013-12-12T05:35Z, which translates to December 12th, 2013 at 05:35am UTC. |
ticket.created_at_with_time | Date and time the ticket was created. For example, February 10, 14:29. |
ticket.current_holiday_name | If the placeholder is used outside of a holiday, it is null. If it is used within a holiday, the holiday's name is displayed. If you've set up multiple schedules, this placeholder respects the list of holidays set in the schedule applied to the ticket. |
ticket.description | The ticket description (the first comment), the agent's name, and the comment date.
Note: If the subject field is empty or not visible to the requester, then this first comment will be used and sent to the requester. This is true for private tickets as well.
|
ticket.due_date | The ticket due date (relevant for tickets of type Task). The format is: May-18. |
ticket.due_date_with_timestamp | The ticket due date (relevant for tickets of type Task) expressed as an iso8601 format date/time. Example: 2013-12-12T05:35+0100 which translates to December 12th, 2013 at 06:35am UTC+1. |
ticket.external_id | The external ticket ID (if one exists). |
ticket.encoded_id | The encoded ID is used for threading incoming email replies into existing tickets. |
ticket.group.name | The group assigned to the ticket. |
ticket.id | The ticket ID. #{{ticket.id}} creates a clickable link. {{ticket.id}} renders the ticket number in plain text. |
ticket.in_business_hours | True or False. True if the ticket update is during business hours. See Setting your business hours. |
ticket.link | Full URL path to ticket. |
ticket.organization.custom_fields.<key_name> | Property/placeholder format for custom organization fields. See Adding custom fields to organizations. |
ticket.organization.custom_fields.<field_key>.title | Property/placeholder format for the option title of a custom organization drop-down field. See Adding custom fields to organizations |
ticket.organization.external_id | External ID of the ticket requester's organization. |
ticket.organization.name | See Organization data above. |
ticket.priority | The ticket priority (Low, Normal, High, Urgent). |
ticket.requester.name | Ticket requester full name. |
ticket.requester.custom_fields.<key_name> | Property/placeholder format for custom user fields. For example, {{ticket.requester.custom_fields.my_custom_field}}. See Adding custom fields to users. |
ticket.requester.custom_fields.<field_key>.title | Property/placeholder format for the option title of a custom user drop-down field. For example, {{ticket.requester.custom_fields.manager_for_approval.title}}. See Adding custom fields to users. |
ticket.status | The ticket status (New, Open, Pending, Solved, Closed). |
ticket.tags | All of the tags attached to the ticket. |
ticket.ticket_field_<field ID number> | Property/placeholder format for custom fields. For example, {{ticket.ticket_field_123}}. See Placeholders for custom fields. |
ticket.ticket_field_option_title_<field ID number> | Property/placeholder format for the option titles of a drop-down custom field. For example, {{ticket.ticket_field_option_title_456}}. See Placeholders for custom fields. |
ticket.ticket_form | Form name for end-users. |
ticket.ticket_type | Ticket type (Question, Incident, Problem, Task). |
ticket.title | The ticket subject. |
ticket.updated_at | Date the ticket was last updated (for example, May18). |
ticket.updated_at_with_time | Time and date the ticket was last updated. For example, February 10, 14:29. |
ticket.updated_at_with_timestamp | Time the ticket was last updated expressed as an iso8601 format date/time. Example: 2013-12-12T05:35Z, which translates to December 12th, 2013 at 05:35am UTC. |
ticket.url | The full URL path to the ticket (excluding "http://"). |
ticket.verbatim_description | The plain text value of the ticket decription (the first comment). |
ticket.via | The source type of the ticket (Web form, Mail, Twitter, etc.). |
account.incoming_phone_number_ID | Zendesk Talk inbound phone number. For example,{{account.incoming_phone_number_123}}. |
Comment data
- Standard objects allow you to use liquid hashes to pick and choose what you want to display, and return a collection of comment and attachment data. For example, you can set up templates to iterate over comments using
{{ticket.comments}}
. - Formatted objects allow you to return preformatted, rendered HTML representations of the standard placeholders, but without a large degree of customization. They simply return comments in predefined formats. For example,
{{ticket.comments_formatted}}
returns a chunk of rendered HTML. The ticket comments will include dates, author, the author’s avatar, and the like. - Rich text objects allow you to use rich text in your customized template (as with the formatted object placeholders) without being restricted to the predefined formatting rules, so you can have more control over the look and feel of your notifications. However, rich text objects do not allow you to include attachments.
Properties/placeholders | Description |
---|---|
ticket.comments | Used as a placeholder, {{ticket.comments}} displays all the comments in a ticket in unformatted text.
Note: Agents will receive both public comments and internal notes; end-users will receive only public comments.
Ticket.comments also serves as a collection for comment and attachment details. You can access the following data using Liquid markup:
For an example of accessing this data in business rules, see Customizing the formatting and placement of text in comments and email notifications. Note: This same comment data collection is available when using the ticket.public_comments, ticket.latest_comment, and ticket.latest_public_comment placeholders.
|
ticket.public_comments | All public comments, most recent first. Unformatted text. |
ticket.latest_comment | The most recent comment. Unformatted text. Does not include attachments, unless Include attachments in email is enabled. To return attachments, use ticket.latest_comment_formatted.
Note: Agents will receive the most recent public comment or internal note; end-users will receive the most recent public comment.
|
ticket.latest_public_comment | The most recent public comment. Unformatted text. |
Properties/placeholders | Description |
---|---|
ticket.comments_formatted | All comments, most recent first.
Note: Agents will receive both public comments and internal notes; end-users will receive only public comments.
|
ticket.public_comments_formatted | All public comments, most recent first. |
ticket.latest_comment_formatted | The most recent comment including any attachments.
Note: Agents will receive the most recent public comment or internal note; end-users will receive the most recent public comment.
|
ticket.latest_public_comment_formatted | The most recent public comment. |
Properties/placeholders | Description |
---|---|
ticket.latest_comment_rich |
The most recent comment. Rich text formatting. Does not include attachments, unless Include attachments in email is enabled.To return attachments, use ticket.latest_comment_formatted. Note: Agents will receive the most recent public comment or internal note; end-users will receive the most recent public comment.
|
ticket.latest_public_comment_rich | The most recent public comment. Rich text formatting |
Satisfaction rating data
Properties | Description |
---|---|
satisfaction.rating_section | A formatted block of text prompting the user to rate satisfaction. |
satisfaction.rating_url | A URL to rate the support. |
satisfaction.current_rating | The text of the current satisfaction rating (e.g. "Good, I am satisfied"). |
satisfaction.positive_rating_url | A URL to rate the support positively. |
satisfaction.negative_rating_url | A URL to rate the support negatively. |
satisfaction.current_comment | The comment that the user added when rating the ticket. |
207 Comments
Fellow Zendeskers - I just posted a request to try to address some of the same needs as many users have stated in the comments here- namely how to format only a portion (in my case the message section) of an otherwise "unformatted" email template. I used your post here as an example of another Zendesk users with a similar need. I'm trying to drum up support to get the Zendesk developers moving on this idea so I'd like to have you look at my post and give it a thumbs up and leave a comment there so we can bolster the case and show the need for these features.
Please take a look:
https://support.zendesk.com/hc/en-us/community/posts/220847487-Add-a-placeholder-for-formatted-comment-values-maybe-comment-value-formatted-
Is it possible to use ticket.group.name in signature? Trying to use {{ticket.group.name}} in signature results in blank
I don't think placeholders work directly in signatures. However we are doing this with a dynamic content code, then the placeholder is in the DC.
If you have access to DCs you should be fine to do this.
Our DC is:
Hi all,
I need you help for a request
Basically I'm using Link Ticket App in the market place
I need to set-up a target extention based on a HTTP URL
https://mysite.zendesk.com/api/v2/tickets/{{ticket.ticket_field_12345678}}.json
The problem is that in the ticket field {{ticket.ticket_field_12345678}} I've a string composed by "child_of:XY" where XY is the ticket number
so Basically I need a trick in order to remove "child_of:" for the customer field during call JSON in order to have a right call and to have only the ticket number
Is something that we can do? I hope that my question makes sense
Thanks to all for any help
D.
The ticket.link and ticket.url are broken. If I use ticket.link I get:
http://
i.e. only http://
If I use ticket.url I get:
http://Liquid error: undefined method `split' for nil:NilClass
How can I get the ticket link back?
When we send our zendesk tickets to Pivotal tracker I send along the comments for context for our developers. (using the message field in the target that I use to send the ticket to Pivotal.) Because I want the description at the top I use ticket.description followed by comments. Because the description is the first comment, that description is displayed a second time at the bottom of the list of comments. ticket.latest_comment seems like a partial solution, but what would be most useful is something like ticket.all_comments_starting_with_the_second. Or can this be accomplished another way?
Hey Mark,
You have a couple of options for this. If you only care about having the description first and don't care that the other comments are listed oldest to newest, try this:
If you want the ticket description, then the other comments newest to oldest, something like this should work:
These are plaintext only. I'm not sure if there is a way to do this with the formatted comments.
Hi everybody!
Is it possible to include a placeholder that displays the last public reply not from the requester of the original ticket?
Thanks!
Mike
I am trying to access the Tags associated to the current user's Organization so that I can use those values to conditionally change display elements on all pages. The problem is that I cannot find any references that work. In the examples above I see {{current_user.organization.name}} used as an example, but when I try to put that into a page display template I only get an error.
Can you point me to instructions on this, or does the capability not exist?
Good morning,
We are having problems with placeholder. Concretely with:
ticket.latest_comment
ticket.latest_comment_formatted
Both placeholders don't return private message to our Agents (bug?). It would be helpful to have this information available.
Regards,
Thanks.
Hello guys,
Sorry if this is some newbie question but, is there a way to navigate through a ticket in order to collect information? and can I put random information present in the ticket inside a variable?
i.e.:
Or at least put the whole content of the ticket inside a string and then do something like this:
and if this is not possible, how do I create my own string variables?
Thanks a lot, I am having a lot of fun working with this since I discovered coding in it.
Hello Raul,
You can do this with liquid - this article may help - https://support.zendesk.com/hc/en-us/articles/203661176-Send-out-different-notification-messages-using-liquid
I'd like to control the output text when using the "satisfaction.positive_rating_url" placeholder.
I know that you can control normal link content by formatting it like this:
[Text you see](URL link)
This doesn't work with the placeholder. Is there a way to accomplish this?
I have the need to use the Organization placeholder in emails but I need it to show all of the possible organizations that an end user could be a member of. In my case the organizations are departments or school sites and some people have several they are assigned to.
How would I be able to get it to show something other than the initial organization the user is assigned to.
Thanks
We created a macro to prepend ticket titles (subject) with {{ticket.group}}. It works as expected when applying that macro one ticket at a time. But when I applied the macro to a batch of tickets using the batch editing interface, the ticket is displayed as expected for agents (views show the title with the group name at the beginning) but our end users see the liquid string, not the name of the group.
Agents see:
[SAT] Title of the ticket
End users see:
[{{ticket.group}}] Title of the ticket
If I manually edit the title, removing the group name and then re-apply the macro to that ticket, everything works as expected.
I am wondering if anyone has suggestions that would save me from having to manually re-edit every single ticket to resolve this issue?
Thanks.
{{ticket.latest_public_comment_formatted}} and {{ticket.public_comments_formatted} do not actually copy the formatting! My hyperlinks do not copy, spaces and paragraph breaks are removed and images do not appear inline.
I would like the follow-up messages created with this macro to be formatted exactly as I sent the original including links, images, and spacing.
I have an open support ticket with Zendesk about this but I was wondering if anyone else has run into this problem?
Is is possible to display the previous ticket state, specifically status?
Ideally, being able to include a summary like the one seen in the events view would be ideal. However, showing a change in status a trigger email (e.g. "{{ticket.last_status}} -> {{ticket.status}}") would meet my immediate intention.
ticket.comments_formatted this placeholder hides the email address in the footer ticket details.
When I use {{current_user.signature}} and {{assignee.signature}} in ticket comments, the placeholder populates the expected data (the agent's signature). However, I am not able to add this to Macros. When I do, using the macro does not populate the expected text - the text input field remains blank. Is there a reason for this?
Is there a way to insert {{ticket.requester.first_name}} without a space being added afterward automatically in comments?
Use case: we respond to clients wth:
Hello {{ticket.requester.first_name}},
but always have to manually delete the space and add the comma.
"Is there a way to insert {{ticket.requester.first_name}} without a space being added afterward automatically in comments?"
Travis - this gets me every time, too!
@Travis:
Can you try {{ ticket.requester.first_name | strip }} ?
Check https://github.com/Shopify/liquid/wiki/Liquid-for-Designers for full guide.
Regards,
Piotr
@Piotr that would only be useful if it was available as a dropdown in the Agent interface. This would be for agents writing replies, not for building templates.
How can we change the text in the placeholder itself?
Good, I'm satisfied.
Bad, I'm unsatisfied.
I am guessing we can use the below links but is there a way to customise the text?
satisfaction.positive_rating_url
satisfaction.negative_rating_url
Dont know if this has been mention but is there a placeholder to get access to visitor notes through Chat message?
Is there a placeholder that will return all public comments formatted EXCEPT for the most recent? I want the most recent comment to look like a direct email and the previous comments to look more formatted. This is the closest I could get, but for the last line I would like {{ticket.public_comments_formatted}} without the most recent comment included. Any thoughts?
{% for comment in ticket.comments limit:1 offset:0 %}
{{comment.value_rich}}
{% for attachment in comment.attachments %}
Attachments:
{{attachment.filename}}
{{attachment.url}}
{% endfor %}
{% endfor %}
-----------------------------------------------------------------------------------------
{{ticket.public_comments_formatted}}
Is there a placeholder for the channel used to submit the ticket?
The documentation for user.role is incorrect. Administrator accounts return as "Admin", not agent.
Thanks for catching that, Charles! I'll request an update to the article to fix this!
It would be very helpful to get an enumeration of the various strings returned by "ticket.via".
Also, it appears that an update from the agent interface returns the same "via" as an update from the API, making them indistinguishable in a trigger.
Please sign in to leave a comment.