Attachments in latest_comment placeholder

1 Comments

  • Remi Saumet
    Zendesk Customer Care

    Hello Otto Lindqvist,

    Thank you for your post here, I hope you are doing well today!

    In order to achieve what you want to do and pass attachments toward an endpoint via JSON, I wouldn't suggest using the following placeholders with your context/scenario : 

    • latest_comment_html
    • latest_comment_formatted


    As indeed, the files / links will be separated by hyphens and no break line, for instance.

    I would recommend using the Ticket.Comment object and Comment.Attachments child-node as explained here > Using Liquid markup to customize the formatting and placement of text in comments and email notifications

    This placeholders are part of our documentation as well : Standard comment placeholders

    I ran a quick test to show you this with a HookBin and here is my Trigger JSON body : 
    {
    {% for comment in ticket.comments limit:1 offset:0 %}
       {% for attachment in comment.attachments %}
       
       "attachmentName" : "{{attachment.filename}}"
       "attachmentURL" : "{{attachment.url}}"
       
       
       {% endfor %}
        {% endfor %}
    }

    And here is the Raw JSON that I received : 

    This will allow you to pull any property's value in an easier way where you just have to query each node / access each attribute's value within the responded object.

    With this placeholder, it will be easier to handle the response as it gives you more granularity coupled with some Liquid Markup condition.

     

    Hope this helps! Have a great rest of your day.

    Best regards,

    0

Please sign in to leave a comment.

Powered by Zendesk