Slack plugin

Overview

The Slack plugin exports campaign execution reports to a Slack channel.

Technology addressed

Slack: https://slack.com/

Dependency

io.qalipsis.plugin:qalipsis-plugin-slack

Configuration namespace

report.export.slack

Configuration

Example configuration file

report:
  export:
    slack:
      enabled: true
      token: ${SLACK_BOT_TOKEN}
      channel: qalipsis-campaign-report
      status:
        - SUCCESSFUL
        - FAILED
        - WARNING

Configuration parameters

Available parameters are described in the table below.

Parameter Description

enabled

Activates or deactivates campaign report publishing to Slack. The publisher bean is created only when enabled is true.
Applicable Step: Events
Optional/Required: Optional
Data Type: Boolean
Default Value: false

Example
enabled: true

token

Bot token used to authenticate requests to Slack API, typically starting with xoxb-.
Applicable Step: Events
Optional/Required: Required
Data Type: String
Default Value: N/A

Example
token: xoxb-your-bot-token

channel

Target Slack channel where notifications are posted.
Applicable Step: Events
Optional/Required: Required
Data Type: String
Default Value: N/A

Example
channel: qalipsis-campaign-report

status

Set of campaign execution statuses that should trigger notification publishing.
If ALL is present, notifications are sent for any campaign report status.
Applicable Step: Events
Optional/Required: Optional
Data Type: Set<ReportExecutionStatus>; ReportExecutionStatus is an enum with values ALL, FAILED, SUCCESSFUL, WARNING, ABORTED.
* Specifying ALL triggers a notification for any campaign report status.
* Specifying two or more status values triggers a notification when the campaign report status is the same as any of the selected status values.
* Specifying just one status value triggers a notification only when the campaign report status is the same as the selected status value.
Default Value: ALL

Example
status:
  - SUCCESSFUL
  - FAILED
  - WARNING

url

Slack API endpoint configuration value.
Applicable Step: Events
Optional/Required: Optional
Data Type: String
Default Value: https://slack.com/api/chat.postMessage

Example
url: https://slack.com/api/chat.postMessage

Creating and installing a Slack app

Creating an app

Create an app from the Slack API website.

  1. Navigate to Slack API website.

  2. Click Create an App.

  3. Select From an app manifest.

  4. Select the development workspace where you will build your app, and click Next.

  5. Replace the manifest content with the JSON object below.

    You can edit display_information and features, but avoid changing the oauth_config block.

  6. Review the app summary.

  7. Click Create App.

    Manifest
{
  "display_information": {
    "name": "QALIPSIS-REPORT-NOTIFIER",
    "description": "QALIPSIS notifications",
    "background_color": "#32373d",
    "long_description": "Receives notifications from QALIPSIS via Slack, including execution reports. Install the app in Slack, configure access in QALIPSIS and be notified in real time when a campaign ends."
  },
  "features": {
    "bot_user": {
      "display_name": "QALIPSIS-REPORT-NOTIFIER",
      "always_online": false
    }
  },
  "oauth_config": {
    "scopes": {
      "bot": [
        "chat:write",
        "chat:write.public",
        "im:read",
        "channels:history",
        "groups:history",
        "mpim:history",
        "im:history",
        "incoming-webhook"
      ]
    }
  },
  "settings": {
    "org_deploy_enabled": false,
    "socket_mode_enabled": false,
    "token_rotation_enabled": false
  }
}

Installing the app into your workspace

  1. From the left panel of Slack API website, click Basic Information.

  2. Click Install to Workspace.

  3. Select or create a channel where QALIPSIS-REPORT-NOTIFIER should post notifications.

  4. Click Allow to complete the installation.

    Reference Documentation

    For further information, refer to the official Slack documentation.