-
Notifications
You must be signed in to change notification settings - Fork 205
How to set Slack channel
When utilizing the Slack orb for CircleCI, you will need to have a channel name or channel ID prepared for your messages to send to. You can reference a channel by its direct name in most cases, such as engineering
or support
(without any #
), but names with certain characters are not supported and so it is recommended to instead use the channel ID.
To obtain a Slack channel's ID:
- Right click the channel name within your desktop client
- From the drop-down context menu, select
Copy link
. - Extract the ID from the URL copied to your clipboard.
Example:
https://<org>.slack.com/archives/<channel id>
The Slack orb expects a default channel to be selected. In the event no channel parameter is provided to the orb, it will fall back on the channel id value stored in the $SLACK_DEFAULT_CHANNEL
environment variable.
This value can be included in the same restricted context holding our OAuth token, which would apply to any project within the org (which uses this context).
Alternatively, the context could not contain the default channel value, and it could instead be set individually on each project: CircleCI environment variables
To change the channel your message will be sent to, or to send to multiple channels at the same time, utilize the channel
parameter of the notify
command. The channel
parameter can accept one or more channels separated by a comma.