Using placeholders

Return to top
Have more questions? Submit a request

51 Comments

  • Brett Bowser
    Zendesk Community Team

    Hey Tech,

    As far as I know the ticket.id placeholder should work in the ticket subject. What exactly are you seeing in the ticket subject when the email goes out to the agent or requester? Is it just showing the title?

    Any chance you could provide a screenshot of the trigger as well as the test ticket you created?

    Let me know!

    0
  • Richard Nuylan

    Hi Brett,

    That is correct. Only the title is being reflected on the auto-response subject line. Here is a screenshot of the trigger setup and the what the end user receives when they get the auto-response:

    Trigger Setup:

    Email Subject:

    As you can see, only the {{ticket.title}} is showing but the [{{ticket.id}}] is missing.

    Thank you!

    0
  • Brett Bowser
    Zendesk Community Team

    Thanks for the update Tech!

    I'm going to create a ticket on your behalf so our Customer Advocacy team can look into this for you.

    We may need to do some testing with you to determine why this isn't showing up.

    Cheers!

    0
  • Dominic Brasoveanu

    Can we add date custom fields too? 

    0
  • Dan Ross
    Community Moderator

    Hey Dominic Brasoveanu,

    You can definitely use placeholders with ticket custom date fields. They follow the same syntax as any other field type. Just make sure you use the ID your custom date field. 

    {{ticket.ticket_field_YOUR-DATE-FIELD-ID}}

     

    0
  • Alejandro González

    Hi! 

    I just wanna know if there is a placeholder about the previous status before change is made, something like ticket.status.last_status

    Thanks a lot!

    0
  • Alejandro Colon

    Active Feature Request (please vote):

    Feature Request: Add a placeholder about the previous status before the change is made

    Alejandro González

    I just posted a Feature Request for this at the link below. If you would like to see this feature please head over there and show your support. Please make sure to add an upvote and comment even if it is simply a "+1"

    Also, you may consider adding it to your post to get the feature request more visible.

    https://support.zendesk.com/hc/en-us/community/posts/360046934113-Feature-Request-Add-a-placeholder-about-the-previous-status-before-the-change-is-made

    0
  • Mark

    Adding a placeholder for a custom user field is not working for me.

    The user field key is "llc_name":

    I'm attempting to use {{ticket.requester.custom_fields.llc_name}} but nothing shows up. What am I doing wrong?

    0
  • Dan Ross
    Community Moderator

    Hi Mark,

    {{ticket.requester.custom_fields.llc_name}} looks valid to me, the only reason I can think of that you get no value returned is if the field is empty. If it's not, I'd suggest creating a ticket with Zendesk Advocacy, as it would look like unexpected behaviour. 

    1
  • Mark

    Hi Dan,

    I tried a few times yesterday and it wasn't working. Due to your confidence, I tried again and now it works. I must have been off on something. Thank you!

    0
  • Nicole S.
    Zendesk Community Team

    Glad to hear you got things sorted, Mark!

    0
  • John Bjorge

    Is {{ticket.comments_formatted} still supported across all clients? I'm experimenting with the exact same example trigger/placeholders. The above placeholder renders in Gmail but it is not rendering in Outlook. 

    When I click "View Available Placeholders" it no longers appears which makes me think it's possibly not supported anymore...?

    0
  • Elissa
    Zendesk Community Team

    Hello John Bjorge

    Firstly, the "View Available Placeholders" is actually a bit of a pain as it doesn't include a lot of the available placeholders in that list, often some of the most used ones! Sorry for any confusion caused by that! The place to go to get an exhaustive list of available placeholders is this article here: Zendesk Support placeholders reference.

    The "{{ticket.comments_formatted}}" placeholder is definitely still supported. You can get an idea of how it works from this information (also in the above article):

    It basically just includes the HTML of your comments rather than having an unformatted version go out. If the content isn't rendering correctly in certain platforms it is possible the platform itself is blocking some of the formatting.

    I hope that helps!

    0
  • Anderson Santos

    Hi there!

    Is there a placeholder that shows the number of Incidents assigned to a Problem ticket?

    0
  • Elissa
    Zendesk Community Team

    Hello Anderson Santos

    I double checked in our Zendesk Support placeholders reference and the only placeholder I could find related to Problem tickets or Incidents is just the one that shows "ticket.ticket_type". So unfortunately I wasn't able to find any that shows number of incidents.

    That being said incident count per problem ticket is definitely something you can report on, if you're interesting in seeing that data for your tickets in a report form. Explore recipe: Measuring the number of incidents by problem.

    I hope that helps!

    0
  • Bojan Nedeljkovic

    Hello team,

     

    Is Liquid markup supported in Notify Target trigger? I am getting parse errors if I try to add markup to json response:

     

    Thanks,

    0
  • Dan Ross
    Community Moderator

    Hey Bojan,

    Yes, Liquid works here, but the JSON validator in Zendesk fails when it sees the {{ }} placeholders. I'd fill it out using a fixed string for testing and then once the JSON is confirmed valid, replace it with the desired placeholder.

    0
  • Bojan Nedeljkovic

    Hi Dan Ross,

     

    I am not sure if I understand you. I created this response:

    It is saved, but when I add this markup, trigger is not firing anymore.  Is it badly formed?

    I want to include all attachments name and url when new ticket is created and send it to webhook.

     

    Thanks.

    0
  • Alejandro Colon

    Bojan Nedeljkovic

    I have had similar issues in the past.

    My guess is the extra comma you have in the for-loop. I am guessing you put it there to separate multiple attachments but it will cause an error and not process the request if there is an extra comma.

    I had to put in logic to omit the comma on the last iteration. I used the following code:

    {% if forloop.last == false %},{% endif %}

    If that doesn't work then there are a couple of other things I would try.

    First is as Dan mentioned, the "JSON validator in Zendesk fails when it sees the {% %} placeholders"
    At this point, there is nothing you can do to fix the JSON validator that is on Zendesk. So, it is worthwhile to confirm that adding the attachments works without using Liquid code. If it works with a fixed string then you can change to a placeholder and it should still work, even with the JSON validator showing that error. 

    I would also check your Liquid code against something that will give you more information. Specifically, because of the lack of error information. What I do is create a temporary trigger and add the Liquid code to an email that will send even if the code is not working. That way I can troubleshoot the Liquid code itself. In this way, I can check to make sure the Liquid code added actually works separately from the request shown. The JSON validator is not going to be helpful in diagnosing an issue with the Liquid code.

    0
  • Bojan Nedeljkovic

    Hi Alejandro Colon,

    I did what you suggested, I have created a simple email trigger with following content:

    {
    "id":"{{ticket.id}}",
    "attachments":[{% for attachment in ticket.latest_comment.attachments %}{"name":" {{attachment.filename}}","url": "{{attachment.url}}"}{% if forloop.last == false %},{% endif %}
    {% endfor %}]
    }

    And I have received email with properly formed JSON this time (formatted in np++):

    And now my trigger is finally firing as expected!

    Thank a million to both of you guys, this is helping me a lot!

     

    0
  • Alejandro Colon

    Bojan Nedeljkovic

    At this point, I would take the fixed string (the output you received with the simple email trigger) and add it to the original request replacing the Liquid code for now. That will test the actual request. 

    If that does not work, then the issue lies with whatever is receiving the request. It might not be expecting it in that format or there is an issue with the space at the front of the name of the attachment. Something along those lines.

    If it does work with the fixed string but does not work with the copied over Liquid code, then I would write it out instead of copying it and pasting it. That can sometimes cause issues. 

    If that does not work, I would reach out to Zendesk support. Liquid is supported. There might be some weird bug you are coming across. They should be able to replicate the issue and dig more into it at that point, as you have demonstrated the Liquid code does work outside of this specific request.

    0

Please sign in to leave a comment.

Powered by Zendesk