|
This article is regarding the Approvals app. |
The advanced message editor section of the approvals template has been built to accept liquid markup. This enables you to pull in just about anything you need from the Zendesk ticket including attachments.
By default, the message section will be a simple multi-field selector, but you can switch it to the advanced at the top right of the field like this:
You'll see that this converts the existing ticket fields you're already selected into a text field with the fields automatically converted to Zendesk placeholders like this:
|
For the following examples, you may adjust the source from which the comments and attachments are collected where is indicated in bold. ticket.comments = all public and private comments ticket.public_comments = all public comments ticket.latest_private_comment = the latest private comment For a full list of placeholders, click here. |
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 %}
After pasting your code snippet into the message editor, it should look something like this:
Finally, click 'submit' to save the change before testing it out.