# Send project updates to Slack, Discord and other chat tools

> Post a project's updates to Slack, Discord, Mattermost, Telegram or Zulip: what gets posted, how to connect each chat tool, and what to do if nothing arrives.

Source: https://docs.leantime.io/using-leantime/integrations/

## At a glance

- Time: about 10 minutes
- Level: Beginner
- You need: The Company Manager role or higher, and access to the project; Permission to add a bot or webhook in your chat tool (Slack, Discord, Mattermost, Telegram or Zulip)
- Where you'll work, in order: 1. Your chat tool, to create the bot or webhook; 2. Leantime, in **Project Settings → Integrations**
- At the end: The project's to-dos, milestones, ideas, comments and goals posted to your chat channel as they change.

A project can post its updates, like new to-dos, status changes and comments, to a chat in Slack, Discord, Mattermost, Telegram or Zulip. Each project has its own settings, so each team can use its own channel. Microsoft Teams isn't one of the options.

## Who can set this up?

You need the **Company Manager** role or higher, and access to the project. **Administrators** and **Owners** can set it up in any project. It's under **Project Settings** at the bottom of the project's left menu. If you don't see **Project Settings**, ask an Administrator.

## What gets posted?

Once a project is connected, Leantime posts a message when someone:

- adds a to-do or changes one, like its status
- adds or changes a milestone
- writes a comment on a to-do, a milestone or the project, including project updates
- adds or changes an idea
- adds or changes a goal or a Blueprint item, or comments on one
- changes the project's details

Each message names the project and links to the item in Leantime. In Slack, Discord, Mattermost and Zulip, it says who did what, like "Ada updated the To-Do: 'Fix the login page'". Slack, Discord and Mattermost also show a to-do's status. In Telegram, a message about a to-do shows its title, status, priority, who it's assigned to and its due date.

Files you upload aren't posted. There's no way to pick which kinds of changes get posted: the project posts all of them, including your own changes.

## How do I connect a project to a chat tool?

1. **Open the project** and click **Project Settings** at the bottom of the left menu.
2. **Open the Integrations tab.** It has a section for each chat tool.
3. **Fill in the section for your tool** (see the steps for each tool below) and click the **Save** under it.

Each section has its own **Save**, and you can connect more than one tool to the same project. There's no test button. To check that it works, add a to-do or a comment in the project and look in your chat.

## How do I connect Slack?

1. **In Slack, create an incoming webhook.** Go to [api.slack.com/apps](https://api.slack.com/apps), click **Create New App**, choose **From scratch**, and pick your workspace. Open **Incoming Webhooks**, switch it on, add a new webhook and choose the channel. (Slack's help: [Sending messages using incoming webhooks](https://api.slack.com/messaging/webhooks).)
2. **Copy the webhook URL.** It starts with `https://hooks.slack.com/services/`.
3. **In Leantime,** paste it into **Webhook URL** in the **Slack** section and click **Save**.

## How do I connect Discord?

1. **In Discord, open the server's settings,** then **Integrations → Webhooks**, and click **New Webhook**.
2. **Choose the channel** the messages should go to.
3. **Click Copy Webhook URL.** It starts with `https://discord.com/api/webhooks/`.
4. **In Leantime,** paste it into the first box under **Webhook URL** in the **Discord** section and click **Save**.

To post to more than one Discord channel, make a webhook in each channel and paste them into the second and third boxes. That's up to three channels per project.

## How do I connect Mattermost?

1. **In Mattermost, open the main menu** and click **Integrations**, then **Incoming Webhooks**.
2. **Click Add Incoming Webhook,** give it a title, choose the channel and save it.
3. **Copy the webhook URL** Mattermost shows you.
4. **In Leantime,** paste it into **Webhook URL** in the **Mattermost** section and click **Save**.

If your Mattermost server is only reachable on your company's network, see [If you host Leantime yourself](#if-you-host-leantime-yourself).

## How do I connect Telegram?

You need a Telegram bot that posts the messages.

1. **Create the bot.** In Telegram, open a chat with [@BotFather](https://t.me/BotFather), send `/newbot` and follow the steps. BotFather gives you a token, like `123456789:ABCdefGhIJKlmNoPQRsTUVwxyZ`.
2. **Add the bot to the chat** where the messages should go:
   - **A chat with just you:** open a chat with your bot and send it a message.
   - **A group:** add the bot to the group, then send a command addressed to it, like `/start@YourBot` (with your bot's username). By default, a bot in a group only sees commands addressed to it, so a plain message or an @mention isn't enough. If you make the bot an admin of the group, any message works.
   - **A channel:** add the bot as an admin that can post messages. For a channel, type the ID yourself (see below).
   - **A group with Topics:** add the bot as an admin, then send a message in the topic you want.
3. **In Leantime,** paste the token into **Bot key** in the **Telegram** section. Leave **Chat / Group ID** and **Topic ID** empty.
4. **Click Save.** Leantime looks up the chat that last sent your bot a message and fills in **Chat / Group ID** (and **Topic ID** for a topic) for you. Do this soon after step 2: Telegram only keeps a bot's messages for a day.

You can also type the IDs yourself, and for a channel you have to. A group or channel ID starts with a minus sign, and most start with `-100`, like `-1001234567890`. If you open the chat in [Telegram Web](https://web.telegram.org), you see its ID at the end of the address. A **Topic ID** is only for groups with Topics. Don't use the number at the start of the bot's token: that's the bot itself, and a bot can't send messages to itself.

## How do I connect Zulip?

1. **In Zulip, create a bot.** Open **Personal settings → Bots**, click **Add a new bot**, choose **Generic bot** and give it a name. (Zulip's help: [Add a bot or integration](https://zulip.com/help/add-a-bot-or-integration).)
2. **Copy the bot's email address and API key** from the bot list.
3. **In Leantime, fill in all five boxes** in the **Zulip** section:
   - **Base URL:** your Zulip address, like `https://company.zulipchat.com`
   - **Bot Email:** the bot's email address
   - **Bot key:** the bot's API key
   - **Stream:** the name of the Zulip channel (Zulip used to call channels "streams")
   - **Topic:** the topic the messages go under, like `Project updates`
4. **Click Save.** If a box is empty, Leantime doesn't save and shows "Zulip integration could not be saved. Please fill out all the fields".

## How do I stop a project posting to a chat tool?

- **Slack, Discord and Mattermost:** open **Project Settings → Integrations**, empty the **Webhook URL** box (for Discord, all the boxes you don't want) and click **Save**.
- **Telegram and Zulip:** Leantime won't save these sections with empty boxes, so stop it on the chat side. In Telegram, remove the bot from the chat, or send `/revoke` to @BotFather to cancel the bot's token. In Zulip, deactivate the bot.

## Does muting a project stop its chat messages?

No. Muting is personal. If you set a project to **Muted** under **My Profile → Notifications → Per-Project Notifications**, you stop getting your own notifications from it (except @mentions and to-dos you're a collaborator on): in the bell, by email, on your phone and through your personal webhook. The project still posts everything to its connected chats. To stop those posts, see [How do I stop a project posting to a chat tool?](#how-do-i-stop-a-project-posting-to-a-chat-tool)

When people on the team have muted the project, the **Integrations** tab tells you how many, like "2 team member(s) have muted notifications for this project." See [Notifications](https://docs.leantime.io/using-leantime/notifications/) for how muting works.

## Why aren't messages arriving?

- **Nothing arrives at all.** Check that the address or token is complete and that you clicked the **Save** in the right section. Then add a to-do in the project to test it. Messages go out the moment something changes; there's no delay or daily batch.
- **It worked before and stopped.** The webhook or bot may have been deleted, or the channel removed or renamed, in the chat tool. Make a new webhook or bot and save it again.
- **Discord: only some channels get messages.** Leantime posts to the boxes in order and stops at the first one that doesn't work, so the channels after it get nothing. Remove or replace the broken address.
- **Telegram: "Telegram integration could not be saved. Send your bot a message first, or provide a Chat ID directly".** Leantime couldn't find a chat that messaged your bot. Make sure the bot is in the chat, send a message (in a group, a command addressed to the bot, like `/start@YourBot`), and click **Save** again within a day. Or type the **Chat / Group ID** yourself, which you always have to do for a channel.
- **Telegram: messages go to the General topic.** Fill in the **Topic ID** of the topic you want.
- **Mattermost or Zulip on your company's network.** See [If you host Leantime yourself](#if-you-host-leantime-yourself). On Leantime Cloud, the chat server has to be reachable from the internet.
- **Links in the messages open the wrong address,** like `localhost`. On your own server, set your public address in `LEAN_APP_URL` (see [Configuration](https://docs.leantime.io/installation/configuration/)).

## If you host Leantime yourself

To protect your network, Leantime doesn't send messages to private addresses, like `localhost`, `10.x.x.x`, `172.16.x.x` to `172.31.x.x` or `192.168.x.x`. Slack, Discord, Telegram and Zulip Cloud are on the internet, so they work as they are. If your Mattermost or Zulip server is only on your company's network, allow it with `LEAN_OUTBOUND_ALLOWED_HOSTS` in `config/.env` (or your Docker settings: with Docker Compose, run `docker compose up -d` afterwards; with `docker run`, start a new container with the setting, as for an [update](https://docs.leantime.io/installation/docker/#how-do-i-update-leantime-in-docker)). This needs Leantime 3.17 or later. List hostnames, IP addresses or ranges, separated by commas:

```
LEAN_OUTBOUND_ALLOWED_HOSTS = 'mattermost.lan,192.168.1.0/24'
```

Public addresses always work. The list only adds the private addresses you name; other private addresses stay blocked. When Leantime blocks an address, its log shows "SSRF guard: blocked private/reserved IP". When a chat tool refuses a message, the log shows "Messenger notification was not delivered", with the tool's name and the error code.