Browse Source

Change the order of fields in slack notifications: start with description, project name and tags. Follow with period, last ping, total pings.

pull/358/head
Pēteris Caune 5 years ago
parent
commit
119965b432
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
2 changed files with 15 additions and 11 deletions
  1. +1
    -0
      CHANGELOG.md
  2. +14
    -11
      templates/integrations/slack_message.json

+ 1
- 0
CHANGELOG.md View File

@ -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)


+ 14
- 11
templates/integrations/slack_message.json View File

@ -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 }}",


Loading…
Cancel
Save