diff --git a/CHANGELOG.md b/CHANGELOG.md index 2cd8edc6..65d76b5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ All notable changes to this project will be documented in this file. - OpsGenie integration returns more detailed error messages - Telegram integration returns more detailed error messages - Added the "Get a single check" API call (#337) +- Display project name in Slack notifications (#342) ### Bug Fixes - The "render_docs" command checks if markdown and pygments is installed (#329) diff --git a/templates/integrations/slack_message.json b/templates/integrations/slack_message.json index 72a08101..618bf6c3 100644 --- a/templates/integrations/slack_message.json +++ b/templates/integrations/slack_message.json @@ -13,17 +13,26 @@ "mrkdwn_in": ["fields"], "text": "“{{ check.name_then_code|escapejs }}” is {{ check.status|upper }}.", "fields": [ + {% if check.desc %} + {"title": "Description", + "value": "{{ check.desc|escapejs }}" + }, + {% endif %} + {% if check.project.name %} {"title": "Project", - "value": "{{ check.project.name|escapejs }}" + "value": "{{ check.project.name|escapejs }}", + "short": true }, {% endif %} - - {% if check.desc %} - {"title": "Description", - "value": "{{ check.desc|escapejs }}" + + {% if check.tags_list %} + {"title": "Tags", + "value": "{% for tag in check.tags_list %}`{{ tag|escapejs }}` {% endfor %}", + "short": true }, {% endif %} + {% if check.kind == "simple" %} {"title": "Period", "value": "{{ check.timeout|hc_duration }}", @@ -45,12 +54,6 @@ "short": true }, - {% if check.tags_list %} - {"title": "Tags", - "value": "{% for tag in check.tags_list %}`{{ tag|escapejs }}` {% endfor %}", - "short": true - }, - {% endif %} {"title": "Total Pings", "value": "{{ check.n_pings }}",