Zendesk Support placeholders reference Follow

Comments

43 comments

  • Avatar
    Jason Littrell

    In my Zendesk account, the "ticket.requester" placeholders are defaulting to the submitter's info on new tickets if the requester field hasn't been populated. For example, if I select a macro that uses the {{ticket.requester.first_name}} placeholder and I haven't populated the requester, the comment text will show "Jason". Is this happening with anyone else?

  • Avatar
    Ed Ball (Edited )

    Is there a placeholder for the Brand? We have been looking for one with no success. If the ticket has a brand and tickets come in with a brand, wouldn't there be a placeholder somewhere for it?

    Nevermind.. {{ticket.brand}}

  • Avatar
    Tsvetan

    Hello,

    Could you please point me, on where to find a placeholder for the second email of the current user. The primary one is {{current_user.email}}, but I need as well a placeholder for the second email attached to the agent.

    Thanks
    Tsvetan

  • Avatar
    Carsten Falborg

    @Tsvetan unfortunatly there isn't a placeholder for the other email adresses for a user in Zendesk with standard placeholders... You should be able to retrieve the emails via the User Endpoint in the API, but im not sure if that would solve your problem...

  • Avatar
    Tsvetan

    Thanks for the reply @Carsten, but yes, this is not my case. It is quite annoying that you can enter second or third emails to an Agents, but then you can't use these as a placeholder. We have different brands for which our Agents have different signatures, with different email addresses and we are applying these through Macroses. Now it seems that we should configure private Macroses per single agent ...

  • Avatar
    Carsten Falborg

    @Tsvetan I think you can write an app, that lets you switch email address... That should be possible...

  • Avatar
    Serge Payette

    Thanks @Tamara (Field) for the info provided on placeholders for custom ticket fields.

  • Avatar
    Arnold Sanchez (Edited )

    would be great to have a placeholder that showed you, in a trigger based email, what the update to a ticket is as you see it in "show all events" - the most recent event(s).

  • Avatar
    Julien Garrigue

    Hello,

    Is it possible to make a placeholder for logmein remote control link?

    Thank you

  • Avatar
    Name

    Can I use fallback? For example:

    Hi {{requester.first_name|fallback:"there"}},

  • Avatar
    Jason Littrell (Edited )

    Allen,

    Normally, you would set up something like:

    Hi {% if ticket.requester.first_name == null %}there{% else %}{{ticket.requester.first_name}}{% endif %},
    

    The problem is that the requester info defaults to the current user when the requester field is blank, so the above if statement can never evaluate as true. As a sort of work around, you can compare the requester and current user IDs, instead:

    Hi {% if ticket.requester.id == current_user.id %}there{% else %}{{ticket.requester.first_name}}{% endif %},
    

    Assuming that you are trying to use this in a macro, this code will check if the ID of the person applying the macro is the same as the ID of the person set as the requester, which will be true if the requester field is blank.

    You can do some other things with the code, too, like passing through the placeholder:

    Hi {% if ticket.requester.id == current_user.id %}{% raw %}{{ticket.requester.first_name}}{% endraw %}{% else %}{{ticket.requester.first_name}}{% endif %},
    

    If the requester field is blank, the comment box will show "Hi {{ticket.requester.first_name}},". Then, when the agent populates the requester field and submits the ticket, the placeholder will be replaced with the requester's first name.

  • Avatar
    Colin Piper

    @Jason - great tip. I particularly like the use of the {% raw %}

  • Avatar
    Tom H.

    It would be great if there was a way to create a placeholder for the cursor in text boxes. So, if I have a template the cursor will be placed in the right location to continue typing your reply. This would be useful, for example, with this type of simple macro...

    Hi {{ticket.requester.first_name}},

    {{cursor}}

    If you have any further questions please reply to this email, thanks.

    The above would place the cursor between the two lines of text so I can just start typing without having to move the cursor to the right location first. This would be especially useful with the Zendesk smartphone app. Also, it seems that the macros collapse more than two line-feeds into one, so, I also have to add extra line feeds into the template to separate the top and bottom line.

  • Avatar
    Thor

    Strange problem we cant solve... I have this in our "comment update" trigger:

    {{ticket.account}}: Ticket ({{ticket.id}}) Re: {{ticket.title}}

    For some reason in the subject line that customers receive from us, it puts the following:

    (Company name), (Ticket number), which is fine, but then it places the subject line and the body of the message all in the subject line, until the character limit is reached and it cuts it off.

    If I remove this from the subject line on that same trigger: Re: {{ticket.title}} it stops putting the subject and the body.

    Why is it not just putting the ticket title? Why is it also adding the whole body of the email in the subject line?

  • Avatar
    Nick Haines

    Hey Thor,

    Can you check to confirm that the "Subject" ticket field is set as "visible" for your End-Users? If it's not visible it'll default to using the first part of the ticket comment.

  • Avatar
    Thor

    That did the trick! Thanks Nick!

  • Avatar
    Paul Lawrence (Edited )

    Hi,

    Is there or will there be a place holder for the original email/ticket sent like ticket.original_email?

    I am looking for a way to exclude any conversation on a ticket when I need to assign the ticket to an external light agent that only needs the original email/ticket submitted in order to respond with the solution that I can relay to the requestor.

     

    Paul

  • Avatar
    Matt Hoffman

    @Paul: I also replied to the ticket you submitted on this topic, but just to cover all our bases - the placeholder you're looking for is ticket.description.

    If you have any additional questions on this topic just drop me a line in that ticket and I'll be happy to help :)

  • Avatar
    Joel Hellman

    I had a support ticket about the Formatted comment data recently, and just wanted to clarify, if any one else tries this, that the formatted comment data objects - like ticket.comments_formatted - has no properties, so you cannot iterate or query it's properties with liquid markup, as you can with the comment data object like ticket.comments.

  • Avatar
    Steve Lacey

    I attempted to hack away the comment timezone problem with the following Liquid, it's based on the assumption that comment created_at is recorded in the same timezone that ticket was – which I'm 98% sure isn't true (see https://support.zendesk.com/hc/en-us/community/posts/203413956-Timezone-information-for-Ticket-comments) but it seems to work in my experiments at least.

    {% capture offset %}
        {% assign offset_neg = ticket.created_at_with_timestamp | split: '-' | last %}
        {% assign offset_pos = ticket.created_at_with_timestamp | split: '+' | last %}
        {% if offset_neg contains 'T' %}
            +{{ offset_pos }}
        {% else %}
            -{{ offset_neg }}
        {% endif %}
    {% endcapture %}

    {% assign offset = offset | strip_newlines | replace: ' ', '' %}

    "created_at": "{{ comment.created_at_with_time | date: "%Y-%m-%dT%H:%M:%S" }}{{ offset }}"

  • Avatar
    Manuel Nieto

    How about placeholder for submitter's location, country, IP?

     

  • Avatar
    Diana Cerame

    Hi all,

    Sorry if this has already been put in here and I missed it - I'm looking to place the URL of our Help Center behind text into the auto-replies that are sent out at ticket creation, and I can't seem to figure out how.

    Currently, I seem to only be able to add the link as a bare URL in the following fashion:

    "We encourage you to browse our robust Knowledge Base for detailed product documentation, helpful pro tips, and much more: https://support.mycompany.com"

    I know placing the URL behind text *can* be done since I see it done in the auto-replies I get from Zendesk when I log a ticket. Hopefully I'm missing something really simple?

    Thanks!

  • Avatar
    Ravi Kant Verma

    Can we use placeholder in macro to set subject ?

  • Avatar
    Matt Hoffman

    @Manuel - Unfortunately there are no placeholders for those items, as they are not tied to the user object or ticket object (technically they are part of the ticket updates). If you want to store that information yourself in a custom ticket or user field, you can then use a placeholder. Keep in mind that user.time_zone and user.locale are available.

    @Diana - What you're looking for is Markdown - special formatting syntax will allow you to make text into a link (among other things)

    @Ravi - Yes, that will work. If you're having problems, drop us a line at support@zendesk.com

  • Avatar
    Mike Edmonds (Edited )

    We use the ticketing system from a 3rd party application. We have fields like "source", "identifier", and "description". Is there a way to parse the values of these into a macro?

     

    Source : pem:1/1
    Identifier : null
    Raise Time : 2016-05-08T10:31:46.000Z
    Clear Time : null
    Description : Environment temperature above high threshold

  • Avatar
    Samus (Edited )

    Not sure if the following information is correct.. I'm able to get attachments using ticket.latest_comment.attachments and unable to see them using ticket.latest_comment_formatted.attachments. I'm using this placeholder in a trigger json body.

    ticket.latest_comment The most recent comment (both public and private). Unformatted text. Does not include attachments. To return attachments, use ticket.latest_comment_formatted.
  • Avatar
    Samus

    The doc says there are two attributes available to use from an attachment:

    comment.attachments

    • attachment.filename
    • attachment.url

    Can we not retrieve other attributes including content_type of the attachment ?

     

  • Avatar
    Elizabeth Toy

    Hi! I don't see a placeholder for the Help Center URL, but I think that would be a good one to add. Especially in the case where one trigger may be used for multiple brands with different Help Center URLs.

    It seems like it'd be simple, since when using {{ticket.link}} it correctly fills the corresponding Help Center URL.

    I'm happy to re-submit this feedback elsewhere that might be more appropriate. Let me know where to do that. Thanks!

  • Avatar
    Graeme Carmichael

    Elizabeth

    We can have some fun with Liquid to create a help centre link.

    Try this in a macro:

    • {{ticket.url | split:'/' | first }}/hc/
  • Avatar
    Rasmus Gregers Sørensen

    Are there any NPS placeholders?

Please sign in to leave a comment.

Powered by Zendesk