Using Liquid markup to support multiple languages in automations, macros, and triggers

Return to top

4 Comments

  • Rom Hirsh

    I have been attempting to copy the comment text (last comment) from one ticket and create another. It's working fine except for the formatting of the comment. I seem to be losing HTML tags and content while calling the new ticket API request.

    I tried to structure the 'html_body' using {{ticket.latest_comment_formatted}} as well as with DC like:

    {% for comment in ticket.comments limit:1 offset:0 %}
    {{comment.value_rich}}
    {% for attachment in comment.attachments %}
    {{attachment.filename}}
    {{attachment.url}}
    {% endfor %}
    {% endfor %}

    But I am losing the original comment formatting in the process - has anyone been able to copy the last comment with formatting and attachments over API?

     

    Example comment (converted to HTML)

    <p>Hi Ops,&nbsp;<br /><br />Please configure the following Account&nbsp;<br /><br /><br /></p>
    <table>
    <tbody>
    <tr>
    <td><strong>Account Type</strong></td>
    <td>Marketing</td>
    </tr>
    <tr>
    <td><strong>Brand Name</strong></td>
    <td>bla bla</td>
    </tr>
    <tr>
    <td><strong>Tenant Name</strong></td>
    <td>blibli EU</td>
    </tr>
    <tr>
    <td><strong>Sendgrid link for OpS</strong></td>
    <td>(Username, Password, API key)&nbsp;<a href="https://pwd.bliblo.net/" target="_blank" rel="noopener noreferrer">https://pwd.bliblo.net/</a></td>
    </tr>
    <tr>
    <td><strong>Email Field</strong></td>
    <td>STR63</td>
    </tr>
    </tbody>
    </table>
    <p><br /><br />Please reply once it is successfully configurated.<br /><br />Thanks,&nbsp;<br />Roni</p>
    <p>&nbsp;</p>
    0
  • Giuseppe
    Zendesk Customer Care

    Hi Rom,

    It's possible that {{comment.value_rich}} is not returning an HTML formatted value because it is under ticket.comments, which displays all the comments in a ticket in unformatted text. See Comment Data

    Instead, could you try using {{ticket.latest_public_comment}} or {{ticket.latest_public_comment_rich}}?

     

    On another note, you may want to check the Linked Ticket app in our Marketplace and see if this also helps with your workflow.

     

    Thanks!

    0
  • Rom Hirsh

    @...

    I tried these as well but still, I cannot get HTML to render while updating the ticket via HTML. The use of the linked tickets app is not good for me as it required much manual work and I am trying to automate this. 

    Any other suggestions? 

    0
  • Giuseppe
    Zendesk Customer Care

    Hi @...

    I'll be creating a ticket for your query and send an email to you so we can investigate further.

    Thanks!

    0

Please sign in to leave a comment.

Powered by Zendesk