Sending ticket comments and/or attachements to approvers

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

 

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

{% for comment in ticket.public_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 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 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.

 

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk