/xlr-slack-plugin

Slack plugin for XL Release

Primary LanguagePythonMIT LicenseMIT

XL Release Slack Plugin

Build Status Codacy Badge Code Climate

Preface

This document describes the functionality provide by the xlr-slack-plugin

Overview

This plugin provides a notification task to send Slack messages to channels or direct messages. It's based on Incoming Webhooks integration, which provides a URL within an authorization token ready to POST messages. See Slack Incoming Webhooks documentation for background information on post messages from external sources into Slack.

Installation

Copy the plugin JAR file into the SERVER_HOME/plugins directory of XL Release.

Configuration

This configuration allows you to connect to multiple servers or connect to just one. Before to use Slack notification task, it's needed to setup a Slack server definition within the following information:

  • Title: Name of the Slack server definition.
  • Slack URL: Tokenized URL provided by the Incoming WebHook integration.
  • User name: Name to use in the notifications.
  • User icon: Icon to use in the notifications, it should be a icon emoji, e.g. :ghost:.
  • Proxy URL: Proxy URL to use in format http://username:password@proxyurl:proxyport, leave it in blank if isn't required.

slack_sharedconfiguration

Available Tasks

The available tasks for interfacing with Slack. These tasks utilize the Slack REST API and the provided Slack Authentication Configuration.

Notification task

The Slack notification task needs the next information:

  • Server: The Slack server definition to use.
  • Channel: Comma separated list of targets for the notification, use # or @ to refer to a channel or direct message.
  • Message: The notification message text, it could be formatted.

notification

CreateChannel task

This task creates a new channel in slack

CreateChannel

AddUsersToChannel

This task adds a list of users based on their email addresses

AddUsersToChannel

postMessage

This task posts a message to a slack channel based on the channel's ID

postMessage

Adding Slack App

This plugin needs a Slack to communicate. You can create a custom app to to by doing the following:

  1. Got to https://api.slack.com/apps to start building your app

YourApps

  1. Create a Slack App - provide App Name and Workspace

createaslackapp

  1. Add features and functionality - Incoming Webhooks & Permissions

a. Incoming Webhooks

incomingwebhooks

Keep track of the Webhook URL. This will be the URL for sending notifications.

b. Permissions

permissions permissions permissions

Add Slack Permissions as follows:

  • Access information about user's public channels channels:read
  • Modify your private channels channels:write
  • Post to specific channels in Slack incomming-webhook
  • Add a bot user with the username @ chat:write:bot
  • Access your workspace's profile information users:read
  • View email addresses of people on this workspace users:read.email

Keep track of the OAuth Token and Reinstall App

Use the Webhook URL and the OAuth Token to configure the connection in XL Release


References: