Zendesk Support placeholders reference

Return to top

29 Comments

  • Tony 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
  • Tony 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 Manager

    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 Manager

    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 Yuki

    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

    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 Yuki

    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
  • Grzegorz

    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
  • Pierre Granger

    Hello there,

    Is there any way to display previous values for some fields ?
    Like for example, {{ticket.priority}} vs {{ticket.previousPriority}}, so we can highlight what has actually changed in the last edition ?

    Many times we reveice mails but have no idea what have changed on a ticket, so we have to go on ZD to find out.

    Thanks a lot for your help !

    0
  • Dave Dyson
    Zendesk Community Manager

    Hi Pierre -

    I'm afraid going to the agent interface is indeed the best way for an agent to see how fields have changed, as placeholders only show current values.

    I'd highly recommend that you add your use case to this thread in our Feedback on Support topic: Feature Request: Add a placeholder about the previous status before the change is made. Our product team is especially interested in hearing about the details of this problem: the business impact, frequency of impact, who is impacted, and what it costs in time and effort to work around it.

    Thanks!

    0
  • Hugo

    Hi All,
    I have a question about {{satisfaction.rating_section}}
    is it possible to modify the language of the section? It's only available in English (Good I'm satisfied vs I'm not)

    Second question: how can I use this

    satisfaction.positive_rating_url A URL to rate the support positively.
    satisfaction.negative_rating_url A URL to rate the support negatively.

    and put it as a hyperlink? (ctrl+K doesn't work here)
    thanks all

    0
  • Rowan Seymour

    Hi

    We've been using an HTTP target to notify an external system of ticket status changes `{{ticket.status}}` but we noticed that if the agent changes their UI language in Zendesk, that value changes.. "Resolved", "Resolvido" etc.

    Is there any language independent way to get the ticket status? 

    -Rowan

    0
  • Gab Guinto
    Zendesk Customer Care

    Hi Hugo,

    You can use dynamic content to translate the satisfaction rating emails based on user language. You can check this article: Are CSAT surveys multi-lingual?

    About the positive/negative rating links – you can use HTML tags to create hyperlinks with these placeholders. Example:
    <a href="{{satisfaction.positive_rating_url}}"> Click for a postive rating </a>.

    Hope this helps. Thanks Hugo!

    0
  • Gab Guinto
    Zendesk Customer Care

    Hi Rowan,

    The placeholders will always render based on the language set on the user's profile, so I'm afraid there's no option to force system placeholders to display text in a language different from that of the requester's language.

    0
  • Ben Wilcox

    So, the Description doesn't technically seem to be a field as it's just the first comment of a ticket. Which is a bit wierd.  It would be nice to be able to grab that first comment when it's created and put it into a separate field that's reportable if there's a way to do that.  Also, since the first comment becomes the Description, is there any utility for what to do with the last comment, which could be something like "Close Notes"?  Having a way to see close notes in a report outside of having to make a separate field would be very useful.

    0
  • Austin Killey
    Zendesk Customer Care

    Hey there @...,

    Really great questions and solid use cases here.  For a setup like that, that's technically possible, but will sadly go beyond the scope of support for what Support can natively do with ticket comments. 

    Triggers and automations don't have any actions available to fill in ticket text fields like they do with dropdown or multi-select fields, but you could fire a HTTP target as a trigger/automation action instead to update the same ticket via API (pointing to https://subdomainnamehere.zendesk.com/api/v2/tickets/{{ticket.id}}.json).  In this setup, you could tell this hypothetical target to fill in a ticket's text field with the value of {{ticket.description}}.

    It's hugely important to note that we don't officially support this method due to the risk of race conditions and possible ticket collisions, but if you were still determined to have a ticket field filled in with a ticket comment, the target/trigger combo would be the way to do it.

    As for those close notes, having an additional ticket text field to fill in the last ticket comment would also be the best bet I can think of, applying a text field value like {{ticket.comments | last}}.  Explore's reporting data thrives more on ticket fields rather than the content of ticket comments themselves, so just as long as we can have that desired data stored in field values specifically, you'd be all set to report on it in Explore.  Hope this helps!

    0
  • Sham Moodley

    Can placeholders be used in Zendesk guide. I would like to personalize some articles based on the organization name? 

    0
  • Jason Schaeffer

    Hi Sham,

    Placeholders are currently not available for the Guide Product, they are for ticket updates. Can you explain your use case a little more and perhaps there is another solution we can find for you.

    Thanks!

    Jason Schaeffer | Customer Advocate |

    0
  • Sham Moodley

    Hi Jason, 

    Basically, I want to create an article in Guide and based on the Signed-in user's organization, I want some part of that article to pull the organization's name. So the article seems like it is written for that organization, instead of me writing the same article multiple times but just changing the organization name. Hope this helps

    0
  • Stanislav Hlazkov

    Hi! What about user's photo? I see mention of "Avatar" in comments_formatted. But I tried it and see only name. Is there a way to get user's photo content url from placeholders? 

    0
  • Austin Killey
    Zendesk Customer Care

    Really good question, @....

    A user's avatar URL isn't available natively with our user placeholders, but with some custom Liquid code and filters like this split filter, it looks like this is somewhat possible if you pull from those formatted ticket comment placeholders instead.  Since those placeholders are pre-formatted chunks of HTML markup which make the comments look pretty in email notifications, we could try cutting out almost all of the formatting except for the photo URL.

    I got some code working, but ONLY when using it in trigger/automation email notifications, so sadly no luck with displaying photo urls directly within ticket comments themselves. 

    We wouldn't be able to troubleshoot custom Liquid usage like this officially, but maybe something like this code below might just do the trick if you're focusing on pulling the photo URL of the author of the latest comment:

    {% assign newtext = ticket.latest_comment_formatted | split: 'src="' %}
    {% assign evenmoretext = newtext[1] | split: '"' %}
    {{evenmoretext.first}}
    0
  • Stanislav Hlazkov

    Austin K thank you for your reply. We will try to use this trick. I think it will be helpful for us.   

    0
  • Usman Khan

    Can we get the old values from webhook. For example: I updated the ticket Title from "This was my ticket title" to "My ticket title is fine". Can I get the old title which is "This was my ticket title"?

    Thanks

    0

Please sign in to leave a comment.

Powered by Zendesk