cloud-build-notifiers icon indicating copy to clipboard operation
cloud-build-notifiers copied to clipboard

[SLACK] color side bar is not working in notification messages

Open wreulicke opened this issue 2 years ago • 1 comments

Currently (1.15.0 or higher), the color sidebar is not working. The "color" is only available for an element in attachments. But, now, "blocks" is placed outside of "attachments".

So, to get the side color bar, we should change the position of the "blocks".

-	return &slack.WebhookMessage{Attachments: []slack.Attachment{{Color: clr}}, Blocks: &blocks}, nil
+	return &slack.WebhookMessage{Attachments: []slack.Attachment{{Color: clr, Blocks: &blocks}}}, nil

But, the attachments field is not recommended. ref: https://api.slack.com/reference/messaging/payload

I cannot find a way to add a color side bar in Block Kit.

wreulicke avatar Jan 18 '23 10:01 wreulicke

Migration guide for Block Kit says color parameter does not have an alternative in Block Kit. https://api.slack.com/messaging/attachments-to-blocks#direct_equivalents

wreulicke avatar Jan 19 '23 01:01 wreulicke