kasunkv / slack-notification

Slack Notification task with advanced slack message customization for Visual Studio Team Services
MIT License
20 stars 9 forks source link
notifications slack visual-studio-team-services vsts vsts-tasks

Azure DevOps

Slack Notification Task for Azure DevOps

Slack Notification task with advanced slack message customization for Azure DevOps. The task includes the ability to send optional attachments with the standard slack messages. Visual Studio Marketplace: Slack Notification

Using Slack Notification Task

Follow the instructions below to configure the Slack Notification task to send messages to a slack channel or a user.

Getting the Slack API Token

v6.x and Above

The latest version of the Slack Notification task will use Slack Apps for authenticating with the Slack API. You will need the following User Token Scopes included in your token for the task to work properly.

Please follow Generate Slack Token with Slack Apps page for mode details on how to create a Slack App for authentication.

v5.x and Below [Deprecated]

You will need to generate an API token and include it as a secure variable in Azure DevOps build/release definition. You can generate the API token using the Slack Token Generator.

Add the Slack Notification Task

Install the Slack Notification task in to your Azure DevOps account and Search for the task and add it to your build/release definition.

Add Slack Notification Task

Slack Configuration

Send Slack Notification section contains some required configuration options.

Required Configuration

Required Configuration

Notification Options

Slack Notification task provides support for sending attachments along with the message. Sending attachments is optional. There are several configuration options provided, as described below.

Chat Message

Sample Message

File Upload

File Upload

Contributing

All contributions from the GitHub community are welcome.

Installing Dependencies

Navigate to the \buildtask\SlackNotification folder which contains the package.json

# install dependencies listed in package.json
$ npm install

Compile TypeScript Task

A npm script is configured to compile the TypeScript code to JavaScript (ES201)

# compile the TypeScript code
$ npm run build

License

MIT © Kasun Kodagoda