Macros: Giving different responses based on ticket content
Using liquid markup, a macro can give different responses based on the content of your ticket.
Ticket tags
The placeholder {{ticket.tags}} lists the ticket tags as a string with each tag separated by a space. The following macro will give a different response based on the tags on the ticket.
{% assign myTags = ticket.tags | split: ' ' %}
{% for tag in myTags%}
{% case {tag} %}
{% when 'tag1' %}
You have tag1
{% when 'tag2' %}
You have tag2
{% endcase %}
{% endfor %}
Custom Fields
To base macros on custom ticket fields, first find its field ID from Admin>Ticket Fields.
Your macro can then say:
{% case ticket.ticket_field_360000034029%}
{% when 'My Value' %}
Your selected My Value
{% when 'My Value2' %}
Your selected My Value2
{% endcase %}
...as long as your replace 360000034029 with the ticket ID of your custom field.
If using a drop-down field, use the tag values for each option.
Note that the values in the case statement are case sensitive.
You can find out more on custom field placeholders here.
-
Good one! Thanks, Graeme!
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
1 Kommentare