The Slack Integration allows Gravity to send notifications to public and private channels in a Slack workspace.
Step 1: Go to the Notifications page.
The Notification Integrations are located in the Notifications page in our application.
Step 2: Create an Integration
After clicking on the "New Connection" button you can select the type of integration desired. This document will use Slack as an example.
Slack Integration Type
After clicking on the desired Integration Type you will be asked to select a name for your integration and to Add the Gravity Bot to your workspace.
Slack Integration Configuration
After clicking on "Add to Slack" button you will be redirected to a Slack webpage where you will be asked to allow Gravity Bot to connect to your workspace.
Slack Bot Permissions Page
If you are a member of multiple workspaces you can select the one you would like the Gravity Bot to have access to from the top right hand side dropdown.
After clicking "Allow" the Gravity Bot will be added to your workspace and you will be redirected to Gravity where you can save your integration. You can see that the process completed successfully if the "Switch Account" button is present instead of "Add to Slack".
After clicking "Save" your integration is saved and you will see it in your integration list.
Saved Slack Integration
Step 3: Create a Policy
To create a new Policy click on the "New Policy" button and add a Name for your policy, a channel and one or more Notification Event Types.
Slack Policy Configuration
In the channel dropdown you will see all the public channels from your workspace and private channels the Gravity Bot has been added to. If you want Gravity to send notifications to a private channel you must add the Gravity Bot to that channel. For more information please take a look at the Optional Step below.
After adding the Policy Name, Channel and Notifications you can create the Policy by clicking "Create".
Slack Integration and Policy with a Private Channel
After the Policy is created whenever a Notification Event is triggered you will receive a message in your Slack Channel. In the case above whenever a Job Failure happens a message will be sent to the "notifications" channel.
Optional Step: Add Gravity Bot to a Private Slack Channel
To do that go into the Private Slack Channel and search for the shortcut "Add apps to this channel".
Slack Add apps shortcut
Search for Gravity and click the "Add" button next to it.
Adding Gravity Bot to a Private Slack Channel
After you add the Gravity Bot to the Private Channel you can go back in Gravity App and click on the refresh button next to the "Channel" dropdown, after that you will be able to find your private channel in the channels list. \
Slack Job Failure Notification
Slack Job Success Notification