Sending ticket comments and/or attachments to approvers with the Approve app

The message to approvers as defined in the Approval definitions section of the Approve app can be set to pull any information that exists on the ticket. While there is a drop down menu on the right that allows you to add in most things like this...

 

Screen_Shot_2022-08-12_at_2.30.35_pm.png

 

...the message box will also allow you to input your own liquid markup however you like. This includes being able to use any Zendesk placeholder and/or pull various information from the ticket's conversation thread. Below are a few examples of how you can do this:

 

If you want to send all of the comments and attachments made on a ticket prior to the approval being sent you can copy and paste this code:

{% for comment in ticket.comments %}<hr><b>{{comment.author.name}}</b> - {{comment.created_at_with_time}}</br></br>{{comment.value_rich}}{% for attachment in comment.attachments %}<a href='{{attachment.url}}'>{{attachment.filename}}</a></br>{% endfor %}</br>{% endfor %}

 

If you only want to send the last public comment and attachments made on the ticket you can copy and paste this code:

{% for comment in ticket.public_comments %}{% if forloop.first == true %}<hr><b>Last ticket update by: {{comment.author.name}}</b> - {{comment.created_at_with_time}}</br></br>{{comment.value_rich}}{% for attachment in comment.attachments %}<a href='{{attachment.url}}'>{{attachment.filename}}</a></br>{% endfor %}</br>{% else %}{% endif %}{% endfor %}

 

If you only need want to send the ticket attachments on public comments copy and paste this code:

{% for comment in ticket.public_comments %}{% for attachment in comment.attachments %}<a href='{{attachment.url}}'>{{attachment.filename}}</a></br>{% endfor %}{% endfor %}

 

If you want to send out the last private comment and attachments:

{% if ticket.latest_private_comment %}{{ticket.latest_private_comment.value_rich}}{% for attachment in ticket.latest_private_comment.attachments %}<a href='{{attachment.url}}'>{{attachment.filename}}</a></br>{% endfor %}
{% endif %}

 

If you want to sent out the the last private comment & attachments, but only if the last comment was private

{% unless ticket.latest_comment.is_public %}
{{ticket.latest_private_comment.value_rich}}{% for attachment in ticket.latest_private_comment.attachments %}<a href='{{attachment.url}}'>{{attachment.filename}}</a></br>{% endfor %}
{% endunless %}

 


Once you've made a selection above, then simply and copy and past the liquid into the message section, and at the bottom click OK, like this:

 

SweetHawk____Zendesk.jpg


Was this article helpful?
2 out of 2 found this helpful