Sending ticket comments and/or attachments to approvers

 

This article is regarding the Zendesk approvals app Approvals app.
If you're needing information on our newer app named  Zendesk approvals app Approve, please see this section of our knowledge base.

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:

Screen_Shot_2018-03-24_at_11_36_18_am.png

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:

SweetHawk__-_Agent.png

 

 

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:

SweetHawk__-_Agent.png

 

Finally, click 'submit' to save the change before testing it out.

 


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

Comments

0 comments

Please sign in to leave a comment.