如果您熟悉 Zendesk Support 中的占位符,那么您已经对 Liquid Markup 有所了解。它是我们用于启用占位符的模板语言。占位符在自行程序、宏、触发器和小组件中用作动态生成的工单和用户数据的容器。关于 Liquid Markup 您可能不知道的是,您还可以用它来自定义如何选择此数据并将其显示为输出。这是因为 Liquid 还允许您创建简单的编程逻辑,例如 case 语句、if 语句、for 循环等。
通过在宏的评论/描述操作以及自行程序和工单触发器中的给用户电邮操作中直接编写简单的控制语句,您可以在一个自行程序、宏或触发器中完成过去需要在多个自行程序、宏和触发器中进行的操作。触发器。您还可以自定义评论文本的显示方式。消息传送触发器不支持此功能。
您可以在 Liquid for Designers(英语)找到 Liquid 文档。该语言的所有元素均有详细描述。本文是对其工作原理的简要介绍。
Liquid 是一种用于呈现电邮和 HTML 的模板语言。Liquid 是一种可使用占位符自动在评论和电邮通知中放置数据的机制。
- 输出,这是包含在双大括号中的文本输出。
- 标签,包含决定如何用占位符表示数据的编程逻辑。
如果您只是将输出视为等同于占位符,那么您对Liquid 是什么以及它的使用方式的理解只有一半。关于 Liquid 输出您可能不知道的是,除了表示工单和用户数据之外,还有一些方法可用于操作文本字符串和数组。在 Liquid 中,这些方法称为筛选。例如,您可以使用筛选将文本转换为大写字符。关于筛选的用途,这只是最简单的例子之一。有关更多信息,请参阅 Liquid 文档。
要理解 Liquid,另一方面要了解什么是标签以及如何使用标签。标签提供了可用于选择和显示数据的编程逻辑。
使用 Liquid 标签可以创建:
- if else 语句
- case 语句
- for 循环
- cycle
- 变量分配
如需了解更多关于 Liquid Markup 的使用范例,请参阅以下文章:
翻译免责声明:本文章使用自动翻译软件翻译,以便您了解基本内容。 我们已采取合理措施提供准确翻译,但不保证翻译准确性
如对翻译准确性有任何疑问,请以文章的英语版本为准。
65 条评论
Rafael Santos
1900216093524 , I'd use the
PUT /api/v2/tickets/{ticket_id}/tags
endpoint instead ofPUT /api/v2/tickets/update_many
, as the latter creates a background job, which may be rate limited to 30 concurrent jobs for the entire instance.You could use the Add Tags endpoint, as mentioned above, with a payload such as the following:
As for your other question:
The following trigger conditions could help you exclude this from firing on follow-up tickets with the tags:
Of course, it'll depend on your specific use case. You could also try iterating over the
{{ticket.tags}}
placeholder and use Liquid'scontains
.2
Andy F.
Hi Zendesk community! I have a question about using Liquid Markup with Zendesk ticket tags. I've set up A/B testing in our instance (as described in this article: https://ro.roca.work/blog/ab-testing-in-zendesk) and so far, it's mostly been working for us. However, I just identified a scenario that I can't figure out how to solve.
To summarize, every ticket that is created gets assigned either the control or experiment tag. The problem occurs only sometimes with tickets created as followups, as it's possible for a ticket to carry over the previous tags, like control, but then get assigned the experiment tag by the webhook. How would I use liquid markup in this JSON response to tell it not to fire if a ticket already has the control or experiment tag?
{% assign randomizer = ticket.id | modulo:2 %}
{% case randomizer %}
{% when 0 %}
{“ticket”: {“additional_tags”:[“control”]}}
{% when 1 %}
{“ticket”: {“additional_tags”:[“experiment”]}}
{% endcase %}
Thanks in advance for the help!
0
Dainne Kiara Lucena-Laxamana
Hi Oliver!
Greg one of our developers created a workflow guide here that could serve helpful. Hope it helps!
0
Oliver Atkinson
Hello,
Is it possible to change requesters based on the ticket subject using a combination of triggers and liquid markup/webhooks?
I'd use a webhook + automation combination but ideally, we'd need the requester to change immediately rather than wait the 1-hour increment.
The use case is so we don't have to manually change requesters from a no-reply address.
It's trying to create a solution to this question. Any assistance would be greatly appreciated!
0
Mike DR
You're most welcome and have an awesome day ahead too!
0
Hannah Lucid
1263082264889 I had a feeling that would be the case. I looked EVERYWHERE for something. Thank you for your confirmation Mike!! Have a great day.
0
Mike DR
Did a thorough search on this and didn't see a liquid mark up here for highlights: Liquid for Designers.
0
Hannah Lucid
Hello,
Is there a way to highlight text using liquid markup? We want to highlight text in our Macros to help callout important information to our end-users (if they read nothing else, at least they'll read this). Is this possible? If so, how?
0
Carmelo Rigatuso
1264020519590
When I try that, I get no errors when saving my trigger, but I get an error in the email notification:
BUT!!! double-quotes fixes it!
{% if {{ticket.ticket_field_123}} < "3000.00" %}
{{ticket.ticket_field_123}} is LESS THAN $3000.
{% endif %}
{% if {{ticket.ticket_field_123}} > "3000.00" %}
{{ticket.ticket_field_123}} is greater than $3000.
{% endif %}
Wow, that was a wild ride, thanks for the inspiration ;) I can't believe I didn't think of trying that yesterday.
1
Walter
Hi Carmelo,
It looks like the number is being treated as a string.
Try this instead.
{% if {{ticket.ticket_field_123}} < 3000.00 %}
{{ticket.ticket_field_123}} is less than $3000.
{% endif %}
0
登录再写评论。