Slack message formatting

Why can’t I format my slack messages?

Im getting:

And at steps-slack-message/main.go at master · bitrise-steplib/steps-slack-message · GitHub I see that it should be enabled.

So why is my text not bold, and a newlane, any clues?

Can you please include the build log of the Slack step?

+------------------------------------------------------------------------------+
| (11) slack@2.3.0                                                             |
+------------------------------------------------------------------------------+
| id: slack                                                                    |
| version: 2.3.0                                                               |
| collection: https://github.com/bitrise-io/bitrise-steplib.git                |
| toolkit: go                                                                  |
| time: 2017-02-24T07:26:53-08:00                                              |
+------------------------------------------------------------------------------+
|                                                                              |
INFO[07:26:53]  * [OK] Step dependency (go) installed, available. 

Slack configs:
 - WebhookURL: https://hooks.slack.com/services/....z
 - Channel: bitrise-libs
 - FromUsername: TPLib
 - FromUsernameOnError: TPLib FAILED
 - Message: *branch: master, build: #128*\nLatest commit: Prepare for next release
 - MessageOnError: 
 - Color: good
 - ColorOnError: danger
 - Emoji: 
 - EmojiOnError: :no_entry_sign:
 - IconURL: http://.....ework_icon.png
 - IconURLOnError: 

Other configs:
 - IsDebugMode: false
 - IsBuildFailed: false


Slack message successfully sent! 🚀

The issue seems to be that you did input \n as a character into the message/text. That will be encoded as \n, it won’t do a newline!

Simply hit Enter in the input to do a newline:

Result:

Hmm, well, that explains the \n but not why it’s not bold? I’ll have to do some testing, it’s actually a variable set in previous steps. Ill get back :slight_smile:

I’d say most likely the \ character might confuse Slack in this case - it worked as expected if the text did not include \n (see my slack screenshot at Slack message formatting ).

1 Like

Yepp, worked out fine after removing \n. Thank you!

1 Like