Giter Site home page Giter Site logo

gjermshus / vsts-slackbot Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 258 KB

A slackbot that lookup Work Item Ids from Slack channels and post information back to the channel

License: MIT License

JavaScript 9.44% TypeScript 89.26% Dockerfile 1.30%
slack slackbot slackapi vsts visual-studio-team-services

vsts-slackbot's Introduction

Build Status

VSTS-SlackBot

Post info from Work Items in Visual Studio Team Services if a Work Item is mentioned in a channel, group chat or private message

How the bot works

The bot will listen to messages in all channels it's a member of. The bot will extract all accourances of a hashtag (#) followed by a number and search VSTS for this Work Item Id. If it get any matches it will return basic information from each of the items found.

The bot also supports groups messages and direct messages.

Set up bot

A couple of settings are needed for the bot to communicate with both Slack and VSTS.

  1. Goto your Slack site and add a new Bot user and obtain a Slack token.
  2. Goto Visual Studio Team Services and obtain a Personal Token a user that has necessary access rights to the work part of VSTS

Use the tokens obtained to start a instance of vsts-slackbot.

Other settings

BotName - Name of the bot in your Slack Directory.
SlackToken - Token obtained with access to Slack.
VSTSToken - Token obtained with access to VSTS
VSTSDomain - The subdomain to your VSTS account

Alternative for VSTS token is to use alternative user credentials. In that case switch VSTSToken with

VSTSUsername - Username to VSTS account
VSTSPassword - Password set as alternative credentials for VSTS account

Run standalone

To run this bot in a console or as a standalone program a config.json file need to be provided at the root folder of the bot. Example of a config.json file

{
    "BotName": "",
    "SlackToken": "",
    "VSTSDomain": "",
    "VSTSToken": "",
}

Run as container

The following command starts a container with the vsts-slackbot. --name and --restart-always are optional.

 docker run -it -d --name <name> --restart=always -e BotName=<name in slack> -e SlackToken=<SlackToken> -e VSTSToken=<VSTSToken> -e VSTSDomain=<VSTSSubDomain> gjermshus/vsts-slackbot:latest

vsts-slackbot's People

Contributors

gjermshus avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

mknabe

vsts-slackbot's Issues

Support for VSTS token

Today the only supported connection method is using alternative credentials in VSTS.
The bot shopuld support using a token as alternative

Use new Slack app integration

Slack has moved to a new App system using both a secret and a key.
The bot should support this method. This is also needed to support slash commands and custom actions

Add support for Pull Request info

Add support for pulling information about pull requests.
Use ! as character for indicating PR. Example !223 should print information about PR 223.

Template for Slack message

Defining templates of how the message posted to Slack should look like.
Template should be defined using placeholders that will be replaced before posting.

Support for Docker

Add Dockerfile so bot can run in a docker container on both windows server, nano server and linux.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.