Create a Slack web trigger
Set up Slack webtriggers for notifications in Unity Version Control.
Read time 1 minuteLast updated 21 days ago
You can create a web trigger to connect Unity Version Control with Slack to receive notifications. The notification includes the information available to the specific trigger that you use.
Configure Slack
To configure Slack, you first need to make a Slack application with the correct scopes:- In the Apps section, select Add apps > App Directory.
- In the browser that opens, select Build > Your Apps.
- Select Create an App > From scratch.
- Add the name of your app, select the workspace you want to use, and select Create App.
- Select Bots to add bot functionality and then select Review scopes to add.
- Add the following scopes:
channels:readchat:writegroups:readim:readmpim:readusers:read
- Select Install to Workspace or Request to Install, dependent on your workspace permissions, and make a note of the Bot User OAuth Token that generates.
- In the Apps section, select Add apps > App Directory, search for your app and select it.
- Right-click on the app and select View app details.
- Select Add this app to a channel and select the channel you want to use from the dropdown.
Make the web trigger
To create the Slack web trigger, you need the Bot User OAuth Token from when you install your app into Slack, and the channel name of the channel you added the app to. You need to use thewebtrigger-slackwebtriggerwebtrigger-slack https://slack.com/api/chat.postMessage/${channelOrUserId}/${slackBotToken}Example Slack web triggers
The trigger below causes the server to post a message to Slack after every check in made in the servermyPlasticServer-
cm trigger make after-checkin MySlackAfterCheckinTrigger "webtrigger-slack https://slack.com/api/chat.postMessage/<channelId or UserId>/xoxb-SlackBotToken" --server=myPlasticServer
-
cm trigger edit after-checkin 3 "webtrigger-slack https://slack.com/api/chat.postMessage/<channelId or UserId>/xoxb-SlackBotToken"