> For the complete documentation index, see [llms.txt](https://docs.bugbug.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bugbug.io/collaboration/alerts/sending-slack-message.md). Agents can also search and read this documentation through its [MCP server](https://docs.bugbug.io/~gitbook/mcp).

# Sending Slack message

Send BugBug alerts to a Slack channel or a person: set up a Slack alert, test it, and what each message contains for test, suite and schedule runs.

A Slack alert posts a message to a Slack channel, or sends it to a person, when a test, suite or schedule run starts or finishes. It keeps your team updated without opening BugBug.

{% hint style="info" %}
**In short**

* Slack alerts are part of [Alerts](https://docs.bugbug.io/collaboration/alerts.md), available on paid plans. See [pricing](https://bugbug.io/pricing/).
* Connect your Slack workspace first. See [Slack](https://docs.bugbug.io/integrations/slack.md#connect-your-slack-workspace-with-bugbug).
* Every message links to the run in BugBug and shows its result, duration and the failed tests.
* The message has a fixed format. To send your own content, use a [webhook alert](https://docs.bugbug.io/collaboration/alerts/sending-webhook.md).
  {% endhint %}

## Set up a Slack alert

If your Slack workspace isn't connected yet, BugBug asks for permission when you start creating the alert.

<figure><img src="https://3168433179-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKixgeBPbLvnD0l1eiV%2Fuploads%2FUUB3iGJGE3hRxH44y4yk%2FScreenshot%20at%20Oct%2024%2015-21-10.png?alt=media&amp;token=ea65ed99-17cc-4d43-9b81-bc416ea9bcf2" alt="Slack permission request when creating an alert"><figcaption></figcaption></figure>

1. Create an alert in **Alerts** and choose when it's sent. See [Alerts](https://docs.bugbug.io/collaboration/alerts.md).
2. Choose **Slack** as the action.
3. Choose the message type: **Channel message** (most common) or **Direct message**.
4. Choose the channel or the person who gets the message.
5. Click **Trigger Alert** to send a test message, then save the alert.

<figure><img src="https://3168433179-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKixgeBPbLvnD0l1eiV%2Fuploads%2FQkrz4I82vV1n37meUuQ5%2FZrzut%20ekranu%202023-10-23%20o%2015.45.52.png?alt=media&amp;token=00b64f6f-a950-4ae0-b88f-855d585d61fd" alt="Slack message type"><figcaption><p>Message type</p></figcaption></figure>

<figure><img src="https://3168433179-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKixgeBPbLvnD0l1eiV%2Fuploads%2FZRvIaEUUPlEUZRNuT4dM%2FZrzut%20ekranu%202023-10-24%20o%2015.09.05.png?alt=media&amp;token=1f2a666c-a216-411b-817e-d20077a0233f" alt="Choosing the Slack channel or person"><figcaption><p>Channel or person</p></figcaption></figure>

**Trigger Alert** sends a sample message with example data, such as a suite named "Smoke", so you can check that it reaches the right place.

## What the message contains

The first line shows the status, the run number, the name and the project, for example ":x: #123 Suite "Smoke" failed in project "Shop"". The run number links to the run in BugBug. The status icon is :rocket: for started, :white\_check\_mark: for passed, :x: for failed and :exclamation: for error.

### Test runs

| Event           | Contents                                                                                                                                                   |
| --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Started         | Test name, project, link to the run, **Go to test run** button.                                                                                            |
| Passed          | Also duration, profile, method (local or cloud), screen size and who or what started the run.                                                              |
| Failed or error | The same, plus how many steps were completed, the [error code](https://docs.bugbug.io/debugging-tests/error-codes.md) and the group where the step failed. |

### Suite runs

| Event           | Contents                                                                                                                                                                                                                                                                                                                   |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Started         | Suite name, project, link to the run, **Go to suite run** button.                                                                                                                                                                                                                                                          |
| Passed          | Also how many tests passed, duration, profile, method and who or what started the run.                                                                                                                                                                                                                                     |
| Failed or error | Also how many tests failed, how many were skipped, and the list of failed tests, each linked to its test run. A long list ends with "... and more". If a [Before all or After all](https://docs.bugbug.io/organizing-tests/suites.md#before-all-after-all-tests) test failed, the message says that the suite was aborted. |

### Schedule runs

| Event           | Contents                                                                                |
| --------------- | --------------------------------------------------------------------------------------- |
| Started         | Schedule name and project.                                                              |
| Passed          | Also how many tests passed and the duration.                                            |
| Failed or error | Also how many tests failed and the list of failed suites, each linked to its suite run. |

Schedule messages have a **Show in runs history** button that opens runs history filtered to that schedule.

## Customize the message

The Slack message format is the same for everyone and can't be changed. To send your own content, for example to a Slack incoming webhook or another chat tool, [create a webhook alert](https://docs.bugbug.io/collaboration/alerts/sending-webhook.md) with your own body.

## FAQ

<details>

<summary>Does the Slack message include a link to the run?</summary>

Yes. The run number at the start of the message links to the test run or suite run, and the **Go to test run** or **Go to suite run** button opens it too. Failed tests and failed suites in the list are linked to their runs. Schedule messages link to runs history filtered to the schedule.

</details>

<details>

<summary>Can I change what the Slack message says?</summary>

No. The format is fixed. Use a [webhook alert](https://docs.bugbug.io/collaboration/alerts/sending-webhook.md) for your own content.

</details>

<details>

<summary>Can I send alerts to a private channel or to one person?</summary>

Choose **Direct message** to send the alert to a person. For a channel, pick it from the list when you create the alert.

</details>

<details>

<summary>Why didn't the Slack message arrive?</summary>

Check that the Slack workspace is still connected and that the channel still exists and isn't archived. If the channel was removed or BugBug lost access to it, BugBug can't post there until you fix the integration or choose another channel. Use **Trigger Alert** to test it.

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.bugbug.io/collaboration/alerts/sending-slack-message.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
