Custom text replacements for placeholders


  • Stephen Belleau

    Harris Roberts 

    We do something similar using Liquid markup

    For example, if tickets are submitted to us via Mobile SDK, the requester name is "Mobile App User". So our macro uses this string:

    Hi {% if == 'Mobile App User' %}there{% else %}{{ticket.requester.first_name}}{% endif %},

    I don't think it's possible for Zendesk to have a null requester name, but if you know what you're trying to replace -- e.g. email-submitted tickets might commonly use their email address as their name, so maybe use liquid conditions to say "if requester name contains @"? -- then you might be able to solve for it. 

    Good luck! 

  • Jason Littrell

    Stephen Belleau is right about the requester. The requester name is never blank, even when creating a new ticket in the agent interface (in those instances, it defaults to the current user until the requester field is populated).

    For other placeholders, though, you can use the Liquid markup "default" filter. For example, if you wanted to display the assignee name or a fallback if the ticket isn't assigned, you could do something like this:

    {{ | default: 'A member of our support team' }} will get back to you soon.
  • Kay
    Community Moderator

    That could be resolved by creating a user field first_name, which is always empty, unless an agents fills it (or via API).

    {{ticket.requester.custom_fields.first_name | default: 'there' | downcase | capitalize}}



Please sign in to leave a comment.

Powered by Zendesk