Is this idea even possible with Liquid Code and Notify Target?
OK this relates to a trigger
In Action, we use "notify target", and we use "Send feedback to Slack via Http", so we get a prompt in Slack that @calls the people relating to the ticket (technicians). This works fine and is no issue.
But we are moving towards wanting one extra person adding but the difficulty is we only want him getting the @call between 4pm to 6pm at night as he is just providing extra cover when needed.
So is it possible using liquid code to have it call an extra person only after 4pm and before 6pm
The current redacted code I use is this, just for an idea
{
"username": "[ {{ticket.id}} ] Created By {{ticket.requester.name}}",
"icon_emoji" : ":test:",
"channel": "test",
"text": "{{ticket.created_at_with_time}} \n <@Slack User>"
}
Any Ideas or different methods to achieve this, so we add the extra call only after a set time?
-
How about this, does that look about right?
Not sure about the else at the end is it needed?
{% assign hour= 'now' | date:'%k' | plus: 0 %}
{% if hour > 8 or < 16 %}
{
"username": "[ {{ticket.id}} ] Created By {{ticket.requester.name}}",
"icon_emoji" : ":test:",
"channel": "test",
"text": "{{ticket.created_at_with_time}} \n <@Slack User>"
}
{% elsif hour > 16 or < 18 %}
{
"username": "[ {{ticket.id}} ] Created By {{ticket.requester.name}}",
"icon_emoji" : ":test:",
"channel": "test",
"text": "{{ticket.created_at_with_time}} \n <@Slack User> <@Extra Slack User>"
}
{% else %}
{% endif %} -
The Answer seems to be No
The box for feedback to Slack is JSON.
So the html liquid code doesn't work.
Hopefully someone will have another way..
-
Hi Jeremy,
Maybe it's a bit of a long-shot, but when I don't manage to achieve something the easy way with Zendesk, I'm quickly setting up a Google Script Project which you can use as a relay between Zendesk and any 3rd party service there you can implement such a time filter with simple JavaScript. Most of times it's a single JS file with less than 100 lines of code.
For example in my side project here, I am also filtering for business hours.
Cheers,
Please sign in to leave a comment.
3 Comments