Custom text replacements for placeholders

3 Commentaires

  • Stephen Belleau

    Harris Roberts 

    We do something similar using Liquid markup https://support.zendesk.com/hc/en-us/articles/203660966-How-can-I-format-placeholders-with-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 ticket.requester.name == '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! 

    0
  • 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:

    {{ticket.assignee.name | default: 'A member of our support team' }} will get back to you soon.
    0
  • 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}}

     

    0

Vous devez vous connecter pour laisser un commentaire.

Réalisé par Zendesk