Slack Integration for Alerts & Reports
  • 11 Sep 2024
  • 3 Minutes to read
  • Dark
    Light

Slack Integration for Alerts & Reports

  • Dark
    Light

Article summary

Overview

In this article we will discuss how to integrate Slack with Preset in order to receive alerts & reports to a Slack channel.

  • Steps 1 - 6: How to configure Slack
  • Steps 7 - 8: Completing the integration of Slack with Preset

Step 1: Create a Slack Channel

In your Slack, select Create a channel to create a channel to receive Alerts & Reports.

Slack_Create_a_Channel1

Let's call our channel slackalertsandreports.

Slack_Define_Channel_Name1


Step 2: Create an App in Slack

In a separate browser tab, navigate to the Slack API external-link_10x10 page and then select Create an app.

Slack_Create_an_App

The Create an app panel appears. Select From scratch.

Slack_From_Scratch

The Name app & choose workspace panel appears.

In the App Name field, enter a name for your new app — we called ours Preset Alerts and Reports.

In the Pick a workspace to develop your app in field, we selected our workspace — in this case, Acme Co.

Select Create App.

Slack_Name_App_and_Choose_Workspace


Step 3: Create Token and Define Scopes

Create App-Level Token and Define Scope

Now that your app is created, we will create app-level tokens.

Navigate to the App-Level Tokens section and then select Generate Token and Scopes.

Slack_Generate_Token_and_Scopes

In the Token Name field, enter a memorable name for the token — we've named ours presetARtoken.

In the Scope selection field, select the connections:write and authorizations:read scopes.

Select Generate.

Slack_Generate_Token

Your token's details will appear for review. Select Done.

Slack_Generated_Token

Define Bot Token Scopes

In the Main Menu, select OAuth and Permissions.

Slack_Navigate_to_OAuth_and_Permissions

In the Bot Token Scopes section, select Add an OAuth Scope.

Slack_Add_Bot_Token_Scope

Add the following scopes:

  • channels:read
  • files:read
  • chat:write
  • files:write
  • groups:read

Step 4: Install App to Workspace

Now let's go ahead and install your app to the Slack workspace. In the Main Menu, navigate back to the Basic Information screen.

Slack_Navigate_to_Basic_Information

In the Install your app section, select Install to Workspace.

Slack_Install_to_Workspace

Slack will ask permission for the app to access the workspace. Select Allow.

Slack_Allow_Connection


Step 5: Copy Bot Token

Return to the Slack API environment and, in the Main Menu, select OAuth and Permissions.

Slack_Select_OAuth_and_Permissions

In the OAuth Tokens for Your Workspace section, in the Bot User OAuth Token field, select Copy. This will copy the token to your system's clipboard.

This is the token that will be provided to Preset in order to create the integration.

Slack_Copy_Bot_Token1


Step 6: Add App to Slack Channel

Navigate back to the channel you created earlier in Step 1 and, in the message field, enter: /invite @appname.

In the graphic below, we just typed "/invite @" and then selected the app name, Preset Alerts and Reports, from the list of available options.

Slack_Invite_Bot_to_Channel

You will receive a confirmation of the app bot invitation.

Slack_Bot_Invite_Confirmation


Step 7: Connect Slack to Preset

From the Preset Manager—after you first log in to Preset—hover your cursor over the vertical ellipsis (3 dots) icon in a workspace card and then select Connect to Slack.

Preset_Connect_to_Slack

The Connect to Slack panel appears.

In the text-entry field, paste the bot token that you copied in Step 5 into the field.

Select Connect.

If successful, a notification message appears informing you of the workspace change.

Preset_Connect_to_Slack_Token_Entered


Step 8: Selecting the Slack Notification Method

Great work! Preset and Slack are now integrated and you can deliver alerts and/or reports directly to a Slack channel.

To use this integration, in the Notifcation method section of the alert or report creation screen, select Slack as your delivery method, as shown below:

Preset_Select_Slack_Notification_Method

In the SLACK text-entry field, enter the name of the Slack channel you created in Step 1. In the example below, we entered slackalertsandreports.

Preset_Completed_Notification_Method

Here is an example of a report with Slack selected as the delivery method.

Preset_New_Report_Send_to_Slack_Channel

When the alert or report is triggered, then the results will be delivered to the specified Slack channel.

Here is what the above report looks like when delivered to the Slack channel:

Slack_Received_Report


Was this article helpful?