Zendesk Support placeholders reference

Return to top
Have more questions? Submit a request

216 Comments

  • Naomi Watnick

    Thanks Jason Littrell ! That worked.  I experimented and got it up to 2980 :-)

    0
  • Ibrahim

    I see that in this reference the Answer Bot placeholders are missing. Why?

     

    How can the whitelisting labels which are used for narrowing Answer Bot trigger searches be set using liquid?

    The idea is that Answer Bot searches can be narrowed using the whitelist labels which are set in the trigger configuration.

    If there are 10 products, say, and I want Answer Bot searches to be confined only to the product mentioned in the query body, then I would have to creat 10 Anser Bot triggers, 1 for each product.

     

    Using liquid it would be possible to search for product names in the query body and then set the whitelist label. So, instead of having 10 Answer Bot triggers, only 1 Answer Bot trigger is necessary.

     

     

    0
  • Donald Cornel

    Hi, is there any placeholder showing only the first comment of the ticket weather it's a public or internal note?

    0
  • Graeme Carmichael
    Community Moderator

    Donald

    Rather counter intuitive but you can get the first comment of a ticket with:

    {{ticket.comments.last}}

    Or you can use

    {{ticket.description}}​ 

    Which will give some additional information on the  assignee name, date and if the comment is private.

    To assess if the fist comment is public, use:

    {{ticket.comments.last.is_public}}

    This returns true for a public comment and false if private.

     

     

    1
  • Alejandro Colon

    @Graeme Carmichael

    Thank you so much.

    I have asked Zendesk to provide the available placeholders and modifiers that we can use. This is the first I have seen of the ".last" and ".is_public" those are very helpful. 

    Do you know of any others?

    0
  • Graeme Carmichael
    Community Moderator

    Alejandro

    Most of the placeholders are detailed in this very article.

    For help with the liquid language, I normally just google ' liquid markup' and some text about what I am trying to do and normally something pops up.

    I need a little refresher from time to time as it is not something I need to do every day. But it is a great feature. 

    0
  • Patrycja Mrowiec

    Hi, is there a way to get the email to which a support email was sent? We have multiple emails like help@companydomain, support@companydomain etc and I would like to use a placeholder with the specific email that received the ticket in a trigger.

    0
  • Andrew J
    Community Moderator

    What is your use case for this?

    0
  • Patrycja Mrowiec

    I'm creating a trigger that sends a bunch of ticket details to an external target which then inserts them into DataDog metrics. We would like to be able to filter our monitoring based on the support email that received the ticket.

    0
  • Alejandro Colon

    Patrycja Mrowiec

    I remembered in the API docs that you can query that info. 

    https://developer.zendesk.com/rest_api/docs/support/tickets

    I don't have time to test but I would see if "ticket.recipient" would work. According to the API, it is listed as "recipient - The original recipient e-mail address of the ticket"

    0
  • Donald Cornel

    Hello,

    I'm looking for a placeholder to get the first comment regardless if it's a public or private comment.

    0
  • Brett Bowser
    Zendesk Community Team

    Hey Donald,

    Unfortunately there's no first comment placeholder. You'd need to use either ticket.latest_comment_formatted to get the latest comment or ticket.comments_formatted which will give you a list of all comments. If you're an agent on the account you will see both public and private comments with those placeholders.

    Let me know if you have any other questions!

    0
  • Crawford Philleo

    Donald - I think you can access what you're looking for by using the 'last' method on the placeholder: `{{ticket.comments.last}}`

    0
  • Donald Cornel

    Hi Crawford Philleo,

    I'm good with this. Thanks man for sharing this placeholder.

    0
  • Donald Cornel

    Though, my next dilemma is that if the first comment is private, only the agent can receive it. The one being sent to the customer is the first public comment.

    Is there any way that the first private message can be sent to the customer?

    Because for the cases that a light agent sent the first email on behalf of the customer, then a ticket will be created as an internal note. The agent will just change the requester to the customer's email. I would like to include it on the notification to the customer when the ticket has been solved.

    Any workaround out there?

    Thanks.

    0
  • Jonathan March
    Community Moderator

    Donald,

    > Is there any way that the first private message can be sent to the customer?

    There is not. From my perspective as a longtime ZD user, this restriction is not only appropriate but essential. An important security feature of ZD is that we can be sure that internal comments will not accidentally be sent to the customer. Sometimes this causes some inconvenience, but the added security / privacy / confidence is well worth it.

    If you want a fundamentally different workflow, you can code it using the API.

    Or, more realistically for most support desks, write a macro to copy the oldest comment using {{ticket.comments.last}} as Crawford mentioned (though the fact that this is not formatted might sometimes be awkward), possibly with some additional boilerplate, and then send it manually as a public comment.

     

     

    0
  • Anthony Williamson

    Is it possible to create a custom place holder somehow? We are a multibrand site and want to change the closing salutation in a macro based on the Brand assigned

    Thank you for choosing {{ticket.brand.name}}, {{ticket.brand.slogan}} with the custom created markup slogan being different depending on the brand selected...

    0
  • David Coleman

    You could test ticket.brand.name value and then compute the slogan. This code isn't exact, but should get you started. Change the field to test and swap greeting for slogan and you are on your way...

    {% if ticket.ticket_field_47199008 != blank %}

    {% assign greeting = 'your order' %}

    {% else %}

    {% assign greeting = 'reaching out' %}

    {% endif %}

    Hi {{ticket.requester.first_name}},

    Thanks so much for {{greeting}}! {% if ticket.ticket_field_47199008 != blank %}[[I'm so sorry...]]{% endif %}

     

    [[Your message here]]

     

    Please let me know if you have any other questions!

     

    Thanks,

    {{current_user.first_name}}

    2
  • Anthony Williamson

    Thanks David - this is useful and gives me some ideas

    1
  • Arne Cools

    Is there a placeholder for 'update_type' -> 'change' or 'create?

    0
  • Brett Bowser
    Zendesk Community Team

    Hey Arne,

    I did some digging on my end and it doesn't look like this placeholder is available at this time. I would recommend creating a feedback post in our Support Feedback topic and share your use-case for our product managers to review.

    Thanks!

    0
  • Arne Cools

    Thanks for looking, I found another solution so I wont need that after al.

    I found serveral other problems with the placeholders unfortunatly.

    - "comment.created_at_with_time" doesnt contain 'seconds' accuracy. 

    - There doenst seem to be way to get the 'via' or 'via_id' property from a comment.

    Oddly enough when I print 'ticket.comments', I get a strangely formatted string of all the comments where via_id property is present & time_created DOES contain a timestamp with 'seconds' accuracy. But when I loop over the comments I'm unable to get those properties:

    Looking like this: '[#<Comment id: 713910160240, account_id: 10577763, parent_id: 713910160000, ticket_id: 370169376299, author_id: 378252941419, created_at: "2021-01-29 16:03:06", via_id: 5, via_reference_id: nil, is_public: true, type: "Comment", value: "<p>test</p>#", value_previous: "rich", value_reference: nil, updated_at: "2021-01-29 16:03:06", notification_sent_at: nil>, [...omitted...] #<Comment id ...'

    - ticket.status & ticket.priority return a translated and capitalized version, which is also not ideal

     

     

    1
  • Dave Dyson
    Zendesk Community Team

    Hi Arne,

    Similar to Brett's response above, your feedback on comment.create_at_with_time, via/via_id. ticket.status and ticket.priority will be best served by creating a post in our Support Feedback forum. We welcome your feedback, and we've provided a guide to creating an effective post here: Product feedback guidelines & how to write a good feedback post

    As for the tickets.comments placeholder, that's functioning as designed - it allows you to use Liquid Markup to parse and format the comments in a customizable way: see Using Liquid markup to customize the formatting and placement of text in comments and email notifications. Hope that helps clarify things!

    0
  • Pedro Coelho

    Hi Dave,

    I've been struggling with the same problems as Arne: the `created_at_with_time` field's usefulness would be greatly improved if the field had at least second level precision, instead of minute. The `created_at_with_timestamp` placeholder exists for the ticket, so it's just a matter of porting it to the comment model as well. That would definitely solve my problem at least.

    Another thing that would be immensely useful would be being able to list the ticket's custom fields without prior knowledge about what fields exist, similar to calling the `/api/v2/tickets` endpoint.

    As for the weirdness in the `tickets.comments`: that looks like the standard output from printing a Ruby on Rails model (or using the inspect method). While I certainly can't argue about whether it is intentional or not, it is not usually a good practice, as it may lead to a couple of security problems down the road (without extra configuration, if you add extra fields to the Comment model they will show up in that representation whether you want it or not).

    0
  • Anaïs

    Hi !

    I'm confused about which URL the placeholders {{ticket.link}} and #{{ticket.id}} point to. It looks like in some case, they render the URL in the help center (/hc/requests) and sometime the ticket's URL in the agent's space (/agent/tickets/) : is it agent's space in a notification to an agent and the help center's URL when sent to the requester and CCs ?

    Which placeholder shall I use to get the link to the help center (/hc/requests) to communicate to an external user in a trigger/automation/macro/dynamic content ?

    I would like to put the link to the request in the help center in a notification to the assignee (by automation), which can be transfered to end-users.

    0
  • Madison Davis
    Zendesk Community Team

    Hi Anaïs! Your understanding is accurate. {{ticket.link}} will show you a full URL:

    -To agents, it will show yoursubdomain.zendesk.com/agent/tickets/123

    -To end users, it will show yoursubdomain.zendesk.com/hc/requests/123 

    {{ticket.id}} only renders the ID itself and is only a clickable URL for agents. So it sounds like you'll want to use {{ticket.link}}!

    0
  • Anaïs

    Thanks for your confirmation, Madison.

    I was imprecise in my message as to {{ticket.id}}, but I was refering to the formula #{{ticket.id}} which apparently behaves the same way as {{ticket.link}}, that is, according to the recipient/target, it renders a link to agent/tickets/ or hc/requests/.

    So, using {{ticket.id}}, I could write the URL to the end user’s request page - hc/requests/{{ticket.id}}, but since I can’t put html code in the message area, there’s no way of sending the link to this page to an agent (I'm thinking of a message via automation) ?

    1
  • Jonathan Brown

    Is there a way to get the id of the linked ticket (problem ticket) as a placeholder?

    feels like an oversite if we can access custom fields but not an existing zendesk field to get data

    0
  • Vikki Keeble

    I've been tasked with seeing if it's possible to change the feedback to read

    What went well? (in green)
    Even better if? (in orange)
    What did not go so well? (in red) 

    Is it possible for me to do with the current place holders? Or would custom HTML need to be written? 

    0
  • Greg
    Zendesk Customer Advocate

    Hi Jonathan!

    At the moment, there's no placeholder that would pull in the ticket details of the linked problem ticket. However, it may be possible to use our API to pull that information into the email notification itself. Please take a look at our API documentation where you'll find further information on the endpoints that your developers could use: https://developer.zendesk.com/rest_api/docs/support/tickets#listing-ticket-problems In terms of how you would leverage the API to pull that information into the ticket, please remember that it's down to your own custom workflow.

    Hi Vikki!

    If you'd like to add the styling to your text, the best way to make such changes would be by either using the Markdown or the HTML code. I have included a link to our Help Centre documentation so that you can check where you can use either of these: https://support.zendesk.com/hc/en-us/articles/224594167 Since support placeholders return just a plain text, you would need to wrap them around a code to add some formatting.

    0

Please sign in to leave a comment.

Powered by Zendesk