How to dynamically customize Slack notifications based on Ticket Status or Priority

2 コメント

  • Eitan Blumin
    コメントアクション Permalink

    I eventually managed to implement this on my own (more or less) after I learned some Liquid Markup basics and realized that it's case and language sensitive...

    I came up with the following JSON payload that works decently (at least for English language, anyway):

    "pretext": "{{ticket.status}} {{ticket.ticket_type}} update by *{{}}*:",
    "fallback": "{{ticket.status}} {{ticket.ticket_type}} #{{}} has been updated at {{ticket.updated_at_with_time}}",
    "author_name": "Ticket #{{}} [{{}}] via {{ticket.via}}",
    "title": "{{ticket.title}}",
    "title_link": "{{}}",
    "footer": "Status: {{ticket.status}} | Priority: {{ticket.priority}} | {{ticket.updated_at_with_time}}",
    "footer_icon": "{{ticket.status | downcase}}.png",
    "color": "{% case ticket.priority %}{% when 'Low' %}#9fc6c6{% when 'Normal' %}#F09000{% else %}#D00000{% endcase %}",
    "text": "*{{dc.requester}}:* {{}}\n*{{dc.assignee}}:* {{}} \n{{ticket.latest_comment}}"


    See attached screenshot for how these notifications look like in Slack.

  • Danny Koss
    コメントアクション Permalink

    Super helpful, thank you.

    I'm trying to change the color based on whether the last comment was public or private.  I have the following, but it's not quite right...

    "color": "{% if comment.is_public == true %}#269ecb{% else %}#ffe2b3{% endif %}",

    Any suggestions?



Powered by Zendesk