I am curious as to why the text field has been added to Slack notifications. It looks odd and doesn’t render properly. It looks like it was added here:
grafana:master
← grafana:bugfix/20889
opened 04:21PM - 24 Jan 20 UTC
**What this PR does / why we need it**:
Fix mentioning users and groups in Slac… k notifications. The current mentioning doesn't work, as you need special Markdown syntax in order to mention users and groups with the current Slack API. You also [need to refer to IDs](https://api.slack.com/changelog/2017-09-the-one-about-usernames) instead of user/group handles.
TODO: Check what happens when Json has an old Mention field
**Which issue(s) this PR fixes**:
Fixes #19938.
"fallback": evalContext.GetNotificationTitle(),
"fields": fields,
"footer": "Grafana v" + setting.BuildVersion,
"footer_icon": "https://grafana.com/assets/img/fav32.png",
"ts": time.Now().Unix(),
}
if imageURL != "" {
attachment["image_url"] = imageURL
}
body := map[string]interface{}{
"text": evalContext.GetNotificationTitle(),
"blocks": blocks,
"attachments": []map[string]interface{}{
attachment,
},
"parse": "full", // to linkify urls, users and channels in alert message.
}
//recipient override
if sn.Recipient != "" {
body["channel"] = sn.Recipient
Previous to this (we had v6.6.2) the text field wasn’t added and it was just the attachment itself. However it seems to be a new thing in ~v6.7.1.
Anyone have any ideas? Devs?
I’d still like to get some understanding on why this is. Thanks.