Giter Club home page Giter Club logo

idam-slack-help-bot's Introduction

IDAM slack help bot

Based off of https://github.com/hmcts/ccd-slack-help-bot and https://github.com/hmcts/slack-help-bot

Listens for new posts in a designated Slack channel and raises a corresponding issue in Jira.

Creating the Slack App

Steps
  1. Create a new app in your workspace.
  1. Head to socket mode and enable it. You will then be asked to create a new token (call it jira-integration) This will only have connections:write in the scope. Select Generate. Copy the generated token as this will be required for the idam-slack-help-bot configuration.
  1. Head to Event subscriptions and enable it.
  1. Expand the Subscribe to bot events tab, add the following settings and save changes.
  1. Expand the Subscribe to events on behalf of users tab, add the following settings and save changes.
  1. Head to Interactivity and shortcuts and create a Global shortcut with the following settings and save changes.
  1. Head to Oauth and Permissions and install the app to your workspace. Allow the app the default permissions. Copy the generated Bot User OAuth Access Token as this will be required for the idam-slack-help-bot configuration.
  1. Invite the app in the channel where you would like it to be used in Slack. Make a note of the channel ID as this will later be required in the idam-slack-help-bot configuration. You can get the channel ID by right clicking, 'copy link', and then it will be the bit after archives in the url, e.g. C01APTJAM7D.

Getting Started with the Bot

Prerequisites

Running the application requires the following tools to be installed in your environment:

You need to create a Slack App as detailed in the steps above. For development purposes, this will have to be created in a new Slack workspace. You will also need the JIRA details. For development purposes, these values can be found in the "env.template.txt" file for the HMCTS Jira SBOX Project.

Set the relevant environment variables defined in env.template.txt based on above steps.

Running the application

We use 'Socket mode' so no need to proxy Slack's requests.

Running on Kubernetes

The application can be deployed on Kubernetes using the HMCTS nodejs chart. To avoid exposing sensitive data from the configuration above you can add them as secrets from an Azure Key Vault. See the chart documentation for further info.

Running locally

All configuration requirements listed above can be found in the "env.template.txt" file.

Rename "env.template.txt" to ".env" which is gitignored and safe for secrets.

Source into your shell with:

$ set -o allexport; source .env; set +o allexport

Install dependencies by executing the following command:

$ npm install

Run:

$ npm start

or to automatically restart the server upon any changes:

$ npm run watch

Running locally with Docker

There is no need to source your configuration. The ".env" file will be mounted as a volume.

Create docker image:

  docker-compose build

Run the application by executing the following command:

  docker-compose up

This will start the frontend container exposing the application's port (set to 3000 in this template app).

In order to test if the application is up, you can visit https://localhost:3000/health in your browser. You should get a very basic health page (no styles, etc.).

idam-slack-help-bot's People

Contributors

kiankwa avatar thomas-geraghty avatar renovate[bot] avatar kremi avatar chandkanuri avatar nikola-naydenov-hmcts avatar dependabot[bot] avatar

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.