Recent searches
No recent searches
Trigger - Count Attachments
Answered
Posted Jul 30, 2021
Hello, I'm using the following code in a trigger.
{% for comment in ticket.comments limit:1 offset:0 %}
{{comment.value_rich}}
{% for attachment in comment.attachments %}
{{attachment.filename}} - {{attachment.url}}
{% endfor %}
{% endfor %}
Can I check in the loop whether the comment has an attachment in order to show additional text? Something like that
{% for comment in ticket.comments limit:1 offset:0 %}
{{comment.value_rich}}
{% IF COMMENT HAS ATTACHMENTS %}
Notice: You have to log in to be able to download the attachment. If you don't have an account yet, click Send Password.
{% for attachment in comment.attachments %}
{{attachment.filename}} - {{attachment.url}}
{% endfor %}
{% ENDIF %}
{% endfor %}
What would be the right condition?
0
2
2 comments
ZZ Graeme Carmichael
Linus
Try this:
2
Linus
Hi Graeme, that is the solution. Great!
0