# Pin Slack Message

Pin a message to a Slack channel from a runbook

Pins a message to a Slack channel from within a runbook. Use it to keep an announcement, a decision, or the request that opened a ticket visible at the top of a channel's pinned items.

## How It Works

The agent tells the tool which message to pin, in one of three ways:

1. **A Slack message permalink**, for example `https://acme.slack.com/archives/C0123456789/p1616880476005500`. This takes precedence over the other options.
2. **A channel ID and message timestamp** together, for example channel `C0123456789` and timestamp `1616880476.005500`.
3. **Nothing at all.** When no message is specified, the tool pins the Slack message that opened the current ticket.

Risotto joins the channel if the bot isn't already a member, then pins the message. If the message is already pinned, the tool reports success and takes no further action.

## Authentication

This tool authenticates through the Slack Tools connector. Follow the [Slack Tools Setup](https://www.tryrisotto.com/docs/integrations/tools/slack/setup) guide to configure it.

The connector's bot token needs the `pins:write` and `channels:join` scopes.

> **Warning:** **Check for the missing-scopes banner before relying on this tool.** The
> `pins:write` scope was added to the connector manifest after many
> organizations first connected. If your connector predates it, the tool's page
> in the dashboard shows a **Missing scopes** banner: *"The Slack tools app is
> missing required scopes. Reconnect it on the Slack page."* Click the link in
> the banner, or go to **Settings → Integrations → Slack**, then click
> **Connected** on the **Tools app** card and choose **Reconnect...**, per the
> [Slack Tools
> Setup](https://www.tryrisotto.com/docs/integrations/tools/slack/setup#reconnecting-the-connector) guide,
> to add the scope.

## Configuration Options

- **Bot Token** *(Optional override)* - Per-tool bot token. Takes precedence over the Slack Tools connector. See [per-tool token override](https://www.tryrisotto.com/docs/integrations/tools/slack/setup#per-tool-token-override).
- **Team ID** *(Optional)* - Required only when using a per-tool bot token override.

## Example Runbook Uses

- Pin the requestor's original message when a ticket is escalated so the support team can find it quickly
- Pin an outage or maintenance announcement that Risotto posts to a channel
- Pin a decision or approval summary in a project channel at the end of a workflow

## Limitations

- The tool pins to Slack only. Tickets that started in Microsoft Teams, email, Jira, or the API have no Slack message to pin unless the agent supplies a permalink or a channel ID and timestamp.
- Slack does not allow pinning channel join messages, files, or file comments.
- The bot must be able to join the channel. Private channels the bot hasn't been invited to will fail with a "not in channel" error.

## Troubleshooting

### Missing-scopes banner on the tool page

Your Slack Tools connector app's manifest predates the `pins:write` scope.
Click the link in the banner, or go to **Settings → Integrations → Slack**, then click **Connected** on the **Tools app** card and choose **Reconnect...**, per the [Slack Tools Setup](https://www.tryrisotto.com/docs/integrations/tools/slack/setup#reconnecting-the-connector) guide.

### The bot is not a member of the channel

Risotto joins public channels automatically. For private channels, invite the
connector's bot user to the channel and try again.

### Could not parse the message link

The tool expects a standard Slack permalink in the form
`https://<workspace>.slack.com/archives/<channel ID>/p<timestamp>`. Copy the
link from Slack's **Copy link** action on the message, or provide the
channel ID and message timestamp instead.

## Related

- [Slack Tools Setup](https://www.tryrisotto.com/docs/integrations/tools/slack/setup)
- [Send Slack DM](https://www.tryrisotto.com/docs/integrations/tools/slack/send_dm)
- [Manage Slack Channels](https://www.tryrisotto.com/docs/integrations/tools/slack/manage-slack-channels)

Source: https://www.tryrisotto.com/docs/integrations/tools/slack/pin_message
