Add support of Slack user-group mentioning in the alert message #585
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello,
My team has a single channel for alerts across all our applications. For each application we added a separate Slack user-group (
@gitlab_duty
/@teamcity_duty
for example) that contains one or several engineers on duty and we would like to mention these groups in the alert message.Moira uses Slack API
chat.postMessage
for sending alert messages and that requires us to specify that user group by using the rather complicated syntax<!Subteam^SAZ94GDB8>
(see https://api.slack.com/reference/surfaces/formatting#mentioning-groups). We can't get user-group ID from the Slack Desktop App and we have to use Slack API in order to do that.There is another way: we can specify additional property
Parse
with valuefull
in PostMessageParameters which change how Slack treats the message (see https://api.slack.com/methods/chat.postMessage#formatting). In my opinion this way is more user-friendly and the required changes are minor.