Using placeholders

Return to top

41 Comments

  • Mike Konstantin

    @Administrador and Diogo Maciel,

    It is possible to list the "tag" value (natively) for drop-down options, by utilizing " ticket.ticket_field_id ". To clarify, for drop-down options, this is the behavior:

    • "ticket.ticket_field_id" displays the Tag associated with the field option
    • "ticket.ticket_field_option_title_id" displays the Label/Name associated with the field option

    This is not true for all Field types, but it is possible for single-select drop-down fields.

    ~Konstantin

    3
  • Sabra
    Zendesk Customer Care

    Hey Sydney! You can use the following placeholder format to pull the current user custom user field information:

    {{current_user.custom_fields.<key_name>}}

    For drop-down custom user fields, you'll want to use this format:

    {{current_user.custom_fields.<field_key>.title}}
    2
  • Colleen Hall
    Zendesk Documentation Team

    Hi Mike Konstantin,

    Thank you for providing this solution! And thank you Rudolph Beaton for pointing it out. I've updated the article with this information.

    1
  • Rudolph Beaton

    Shoutout to Mike Konstantin for that perfect solution! Exactly what I needed. That info should be added to the article, Anton de Young / Joyce

    1
  • mccabe.tonna
    Community Moderator

    the checkbox logic should actually be swapped.

    {% if ticket.ticket_field_<insert field_id here> contains 0 %}
    checkbox is unchecked
    {% else %}
    checkbox is checked
    {% endif %}

    should actually be

    {% if ticket.ticket_field_<insert field_id here> contains 1 %}
    checkbox is checked
    {% else %}
    checkbox is unchecked (or null)
    {% endif %}

    reason: when a checkbox is not visible on a form; it returns null value. This accounts for explicitly checked boxes

    1
  • Beto
    Zendesk Customer Care

    Hi there Scott!

    This happens sometimes because the {{ticket.url}} placeholder does not include "http://" or "https://" as you can see on our Placeholder Reference article. This might affect if the url is clickable.

    The easiest solution is to use the {{ticket.link}} placeholder, which does include this, or add the missing section yourself, like this:
    http://{{ticket.url}}
    https://{{ticket.url}}

    I hope this helps!

    1
  • Joyce
    Zendesk Customer Care
    Hey Marc,
     
    Are you looking for the placeholder to use to pull the phone number value on the ticket requester's user field? If so, you can use the placeholder {{ticket.requester.phone}},  which pulls the ticket requester's phone number on file. Check our Zendesk Support placeholders reference for more information.
     
    If it is about the acceptable phone number format that you are inquiring about, phone numbers should be formatted with the internationally standardized E.164 format. E.164 numbers can have a maximum of fifteen digits and are usually written as follows: [+][country code][subscriber number including area code].
    1
  • Dave Dyson

    Hi Andy,

    Where are you attempting to use these? I created a macro in my test account that adds a comment including these two placeholders:

    {{ticket.organization.name}}
    {{ticket.requester.organization.name}}

    If the ticket requester has an associated Organization, the placeholders resolve and display the organization name. I also added these placeholders to the notification text box in my "Notify requesters and CCs of comment update" trigger, and they worked there as well. I think your custom field placeholders above should also work, so long as you're substituting the field ID into the placeholder as instructed in the documentation above. 

    If you're still not able to get these to work, I'd suggest chatting with our support team (Option 1 here: Contacting Zendesk Customer Support), so they can help you troubleshoot.

    0
  • Diogo Maciel
    Zendesk Customer Care
    Hi Arkadiusz! Unfortunately text fields don't work on macros. For macros, dropdown fields are the preferred option.
     
    I encourage you to create a new post in the General Product Feedback topic in our community to engage with other users who have similar needs and discuss possible workarounds. Conversations with a high level of engagement ultimately get flagged for product managers to review when they go through roadmap planning.
     
    Specific examples, details about impact, and how you currently handle things are helpful for our product teams to understand the full scope of the need when working on solutions. You may also want to review the Product feedback guidelines and how to write an effective feedback post [https://support.zendesk.com/hc/en-us/community/posts/360004391547-Product-feedback-guidelines-how-to-write-a-good-feedback-post].
     
    We truly value customer feedback and your voice and votes in the forums help influence future Zendesk functionality.
     
    0
  • Joubin Saedi

    the checkbox logic should actually be swapped.

    {% if ticket.ticket_field_<insert field_id here> contains 0 %}
    checkbox is unchecked
    {% else %}
    checkbox is checked
    {% endif %}

    should actually be

    {% if ticket.ticket_field_<insert field_id here> contains 1 %}
    checkbox is checked
    {% else %}
    checkbox is unchecked (or null)
    {% endif %}



    Can someone give me an example of what the checkbox line will actually look like when you enter it into a the trigger section?

    Screen Value: {{% if ticket.ticket_field_9508015623188 contains 1 %}}

    Screen Value line, from above, does not work for getting if the checkbox was selected. 

    0
  • Lisa Kelly
    Zendesk Documentation Team
    Thanks, Maddie,
    I updated both these Placeholder articles to include the following sentence:
    "When you specify placeholders, remember they are case-sensitive."
    https://support.zendesk.com/hc/en-us/articles/4408886858138
    https://support.zendesk.com/hc/en-us/articles/4408887218330
     
    I'm marking this ticket as Solved. Let me know if you disagree. 
    0
  • Conor Quarry

    Hi,

    Is it possible to create custom Zendesk Placeholders within our Macros, which can then be updated through the API? I'm noticing no API call I make, despite success, changes the field value within, ie, I want to add {{iban}} and {{phone_number}}.

    0
  • Dane
    Zendesk Engineering
    Hi Jeff,
     
    If you can share to use the placeholder that you are using, maybe we can determine what could be causing this behavior. 
    0
  • Rudolph Beaton

    Wooo, thanks for doing that, Colleen Hall!

    0
  • Amit

    Is there any place holder like  {{user_email}} which can display the user email id on the help center page.

    For example:

    {{#if signed_in}}
          <div class="user-info dropdown">
            <button class="dropdown-toggle" aria-haspopup="true">
              {{user_name}}

     

    This show the full name of the user who is logged in on the help centre

    0
  • Albert Lechuga

    Hello, do placeholder work in the Email HTML template. For example, If I add an HTML signature and I use {{current_user.phone}} where the phone number would go, should it display the agent that responded to the ticket's phone number in the HTML signature? I have been unable to get any {{current_user.XXX}} placeholders to show anything in the HTML template. 

    0
  • Diogo Maciel
    Zendesk Customer Care
    Hi Jose! I am sorry, but I am not clear what you mean differentiating "internal label value" and "display value". Could you try contacting us in support via the instructions below so we can have a better look at the account and your flow? Thank you!

    https://support.zendesk.com/hc/en-us/articles/4408843597850-Contacting-Zendesk-Customer-Support
    0
  • Gab Guinto
    Zendesk Customer Care
    Hi Albert,

    I'm afraid the system placeholders like current_user.phone won't work when used within email templates. An alternate solution is to use the signature field in the user profiles; you can use these placeholders within that field. But, at this time, the signature field does not support HTML. You may only use Markdown formatting

    If you can, I suggest that you upvote or add a comment to this product feedback thread - Feature Request: HTML or Rich Text Editor for Signatures.

    Thanks Albert!
    0
  • Administrador

    Hi,

    I am using a drop-down control.
    When using the placeholder: ticket.ticket_field_option_title_id, I see that I am getting the display value and not the internal label value.

    How can I get the internal label, or is it not possible?

    Regards

    0
  • Tipene Hughes
    Zendesk Developer Advocacy

    Hi Chin Sin,

    Placeholders cannot be used to populate custom ticket fields, unfortunately. In addition, we advise against using triggers and webhooks to update tickets using the API as this can potentially lead to race conditions which may result in unexpected behavior. Here’s an article which goes in to more detail:

    

https://support.zendesk.com/hc/en-us/articles/4408882855578-Can-I-use-a-trigger-and-a-webhook-to-update-tickets-

    One possible way you could achieve the same result is using a background ZAF app that makes a PUT request to the tickets API in response to an event. You can find out more about the apps framework here:

    https://developer.zendesk.com/documentation/apps/app-developer-guide/using-the-apps-framework/

    I hope this helps! Feel free to reach out with any questions.

    Tipene

    Edit: See following comment for clarification around testing custom fields and placeholders

    0
  • Marc Iacobino

    Hello, what is the correct format for the "phone" placeholder? For example, for as French number such as ... (+33) 12 45 78 78

    0
  • Mike Konstantin

    Ke Zhao,

    Out of  curiosity, are you running all of this in one command? If so, it won't work (from similar testing and work I've performed), as Zendesk doesn't understand who the Requester is until the ticket is actually saved with the Requester's details. It is best to perform this within two steps (first create the ticket, then have automation apply the Macro).

    ~Konstantin

    0
  • Andy M

    I've tried every variation of trying to get anything in the organization to come back and its always blank

    {{custom_fields.custom_cust_id}}},
    {{ticket.organization.name}}
    {{ticket.requester.organization.name}}
    {{ticket.requester.organization.external_id}}
    {{ticket.requester.org..custom_cust_id}}
    {{ticket.requester.organization.custom_fields..custom_cust_id}}
    {{ticket.requester.organization.custom_cust_id}}

    0
  • Diogo Maciel
    Zendesk Customer Care
    Hi Jose!

    Ah I see, thank you for clarifying. Yes, unfortunately placeholders will only display the value of the field and not the associated tag. The tag present in dropdown fields' values serve mainly to have a referenceable value internally for things like searches, viewsa and reports. I am sorry for the inconvenience.
    0
  • Dave Dyson
    Thanks McCabe, I've alerted our docs team. Good catch!
    0
  • Arkadiusz Szafraniec

    Hi Everyone!

    Does {{ticket.ticket_field_<field ID number>}}  works with a text field? 
    I've tried on macro and it didn't work. Value in a comment is always blank.

    0
  • Jeff Killian

    Hi Joyce,
    I am trying to use a custom user field in a macro but the format is coming back reading:

    2022-01-15 00:00:00 +0000

    The data in the customer profile shows "January 15, 2022" which matches the format I want to use in my Macro.  Can you help me solve this please?   

    0
  • Mike dela Rosa
    Zendesk Customer Care
    Hey Chinchane,
     
    I see you have an open ticket for this, will reach out to you there!
    0
  • Sydney Neubauer

    Is there a placeholder for the current users custom field? There is "ticket.requester.custom_fields.<key_name>" but this pulls in the requester's custom field and not the current User making the comment.

    0
  • Administrador

    Hi Diogo,

    I am referring to the values and the tags of the field values:

     

    1: is the value the customer sees

    2: is the tag, the internal value of the field value

    Regards.

    0

Please sign in to leave a comment.

Powered by Zendesk