Skip to content

Latest commit

 

History

History
77 lines (70 loc) · 5.49 KB

README.md

File metadata and controls

77 lines (70 loc) · 5.49 KB

Get a DM in Slack when mentioned in a Jira Comment!

What is this App?

Read about how Group Nine created an application that sends us direct messages in Slack when we get mentioned in Jira comments: https://medium.com/group-nine-media-product-team/slack-notifications-for-jira-comments-1d57879bc149

Setup Instructions

Step-by-Step video
step by step video on YouTube

To setup this application you'll need:

  • A Heroku account
  • Admin access to your Slack instance
  • Admin access to your Jira instance (this setup assumes you're using Jira Cloud)
  1. Setup a Slack application
  • Go to https://api.slack.com/apps and click "Create New App"
  • Provide an Application Name ("Jira Comment Bot" seems to work well), and choose your Slack workspace from the dropdown
  • Click "Bot Users" in the "Features" section of the left-side navigation and then click "Add a Bot User"
  • Give your bot a display name and default user name and click "Add Bot User"
  • Go to "OAuth & Permissions" in the "Features section of the left-side navigation" and click "Install App to Workspace" (click Authorize on the confirmation screen)
  • Take note of the OAuth Access Token and Bot User OAuth Access Token, we'll need this later
  1. Create a Private / Public RSA Keypair for the Jira Application
  • To create the key pair, open your terminal and type openssl genrsa -out privkey.pem 2048
  • To extract the public key, type the following into your terminal openssl rsa -pubout -in privkey.pem -out pubkey.pem
  • Open privkey.pem in your favorite text editor (privkey.pem should have been generated by the previous steps)
  • Go to https://www.base64encode.org/ and paste the contents of privkey.pem into the top section and click "Encode"
  • Take note of the base64 encoded string that was generated in the bottom section
  1. Setup the app on Heroku
  • Create an account on Heroku: https://signup.heroku.com/ (a free solution for hosting applications)  - Click this deploy button to deploy this app to Heroku 👉 Deploy

  • When asked to enter values for environment variables, do the following...

    • APP_URL = the URL of this heroku application ("https://WHATEVER-YOU-NAMED-THIS.herokuapp.com/") the trailing slash is important
    • JIRA_URL = the URL of your Jira application ("https://YOUR-JIRA-SUBDOMAIN.atlassian.net") the lack of a trailing slash is important
    • RSA_PRIVATE_KEY = the base64 encoded string from step 2
    • SLACKBOT_TOKEN = the Bot User OAuth Access Token from step 1
    • SLACKBOT_OAUTH_TOKEN = the OAuth Access Token from step 1
  1. Setup a Jira Application Link
  1. Setup Jira Webhook for Comments
  1. Add Features to Slack App
  1. Sign Up
  • Sign up by messaging the bot you created with the word "signup" -- click the link that the bot responds with to Auth with Jira
  1. Usage
  • @mention your username in a Jira comment to get a message in Slack

Development

  • When working locally, create a .env file in your local environment with the same Key=Value pairs that were used in Step 3 separated by new lines. Example: JIRA_URL='https://YOUR-URL.atlassian.net'
  • Start up Mongo with mongod in your terminal
  • Install the heroku CLI to start your development environment with heroku local web