Setting up actionable build notifications in Slack
- CloudBees Core Personalized Slack Messaging feature benefits
- Supported versions
- Creating a new Slack App
- Installing the new Slack App in a client workspace
- Installing the CloudBees Slack Integration Plugin
- Adding the Slack Bot Token as secret text
- Getting the most out of notifications with recommended plugins
CloudBees Core Personalized Slack Messaging sends Slack messages directly to you to notify you of relevant status information and build data at the end of the sequence, so that you know if the build was successful, and if not, the actions that need to be taken to get a failed build back on track. The notifications include information on build and test results, including direct links to results and error details.
Sending messages directly to Slack means that you do not need to switch between different tools to be alerted when builds complete, and in the case of failed builds you can take immediate action.
The CloudBees Core Personalized Slack Messaging feature provides the following benefits:
Provides feedback immediately upon completion of a build.
Highlights the causes of build failures quickly.
Limits context switching between tools.
Installs easily and does not require updates to Pipelines.
|This feature does not require any modifications to Pipelines.|
The process of setting up actionable build notifications in Slack requires an Administrator to complete the following steps from Slack’s App API:
And the following steps from the CloudBees Core Master:
The CloudBees Slack Integration plugin is available on the following versions and platforms:
CloudBees Core on modern cloud platforms version 220.127.116.11 (and higher)
CloudBees Core on traditional platforms version 18.104.22.168 (and higher)
The Slack App that Administrators create is a hub for messages that will be used by the CloudBees Slack Integration Plugin to notify users of information regarding builds: failures, JUnit errors, Pipeline Policy violations, or even when the build completes successfully.
|For more information on creating a Slack Application see an introduction to Slack apps in the Slack API documentation.|
Navigate to Slack’s App API in a browser.
Select either Create an App if you have never created a Slack App before
Create New App if you have previously created a Slack App.
Enter an App Name.
Select a Development Slack Workspace from the drop down menu.
Select Create App.
Select App Home in the left nav.
Select Review Scopes to Add.
Scroll down to Scopes.
Select Add an OAuth Scope.
Select and add the following scopes:
Table 1. Scopes Scope Description
Send messages as <App Name>
Send messages as <App Name> with a customized username and avatar
Send messages to channels <App Name> isn’t a member of
View files shared in channels and conversations that <App Name> has been added to
Upload, edit, and delete files as <App Name>
View some URLs in messages
Show previews of URLs in messages
View people in the workspace
View email addresses of people in the workspace
You must include all of the scopes listed or the Slack App will not function properly. For example, without
users:read.email, the plugin won’t be able to retrieve users.
|Admin privileges are required in the Slack workspace to install the new Slack App.|
Sign in to your desired workspace.
Select OAuth & Permissions in the left navigation.
Under OAuth Tokens & Redirect URLs select Install App to Workspace.
Select Copy to copy the Bot User OAuth Access Token.
To install the CloudBees Slack Integration Plugin:
From Operations Center or your CloudBees Core master, select Manage Jenkins > Manage Plugins.
Select the Available tab.
Use the Filter field to search for CloudBees Slack Integration Plugin.
Select the checkbox to choose the CloudBees Slack Integration Plugin.
Select Install without restart to install the plugin.
Adding the Slack Bot token as a secret will allow it to be stored securely within the CloudBees Core master.
From your CloudBees Core Master, navigate to Manage Jenkins > Slack Integration.
Under Slack, to the right of Token, paste the token you copied when Installing the new Slack App in a client workspace.
The CloudBees Slack Integration Plugin is greatly enhanced when it can gather information from others plugins including:
After you have set up CloudBees Core Personalized Slack Messaging in the Slack App API and CloudBees Core, you need to configure users so that they can start receiving messages.