icon

Send a Slack message

Send a Slack message to a channel or group.

Send a Slack message to a Slack user, a group, or a channel. Create and customize the messages however you see fit. Among other things, you can:

  • Set a different text for failed and successful builds.
  • Add an icon and/or emojis to your messages.
  • Set the bot user's name for the messages.
  • Linkify channel names and usernames.
  • Add and customize attachments.

Configuring the Step

To use this Step, you need either a configured Slack Integration in your workspace, an incoming Slack webhook or a Slack bot user with an API token. For the former see your Workspace settings, for the latter two, you can set them up in Slack:

Once you're ready with those, come back to Bitrise and configure the Step itself:

  1. Create a Secret Env Var for either your Slack webhook URL or your Slack API token.
  2. Add the Secret to either the Slack Webhook URL or the Slack API token input.
  3. Toggle the Run if previous Step failed option on - you should see a white checkmark on green background next to it. This allows Slack messages to be sent for failed builds, too.
  4. In the Target Slack channel, group or username, set where the Slack message should be sent.
  5. Customize your messages as you'd like. For the details, see the respective inputs.

In case of the Slack Integration usecase you can copy the ID in your Workspace settings, on the Integrations page. This ID is not senstive, you can use it as a step input as-is, or put it into a regular environment variable.

Note that this step always sends a message (either to channel or channel_on_error). If your use case is to send a message only on success or on failure, then you can run the entire step conditionally.

Troubleshooting

If the Step fails, check your Slack settings, the incoming webhook or the API token, and your Slack channel permissions.

Useful links

Related Steps

Similar steps

Send a Discord message with the build status

Send a Jandi message to a topic.

Sends a custom card message to a Google Chat webhook.

Send Microsoft Teams message to a channel