Skip to content

flexoid/pivotal-slack-preview

Repository files navigation

Pivotal Tracker Slack Preview

Slack app that provides preview of the pivotal tracker stories when story URLs are posted to the channels.

Features

  • Automatically post preview of Pivotal Tracker stories mentioned in the message.

  • Expand story details with message only visible to single user.

  • Configurable number of stories in a single message to ask if preview is needed.

Installation

  1. Deploy this app using preferred way, you can refer to Deployment section. The port needs to be publically available.
  2. Go to Pivotal Tracker profile page. Generate API token, use it as a PIVOTAL_TOKEN environment variable value.
  3. Go to My Apps slack page and create new app. Choose the name (e.g "Pivotal Tracker Slack Preview") and select desired workspace.
  4. On the Basic Information page, copy "Signing Secret" and use it as a SLACK_SIGNING_SECRET environment variable value.
  5. Go to OAuth & Permissions page. Copy "Bot User OAuth Access Token" and use it as a SLACK_TOKEN value.
  6. Add the following OAuth scopes:
    • channels:history
    • channels:read
    • chat:write
    • groups:history
    • im:history
  7. Go to the Event Subscriptions page. Subscribe to the following bot events:
    • message.channels
    • message.groups
    • message.im
  8. Enable events and configure Request URL in the form http://<host>:<port>/events-endpoint. It is more secure to use https, but it will require some reverse proxy with certificate configured.
  9. Go to Interactivity & Shortcuts page. Enable interactivity and add Request URL like http://<host>:<port>/interactive-endpoint.
  10. Add app to the channel. In Slack open:
  • "Channel Details"
  • "(...) More"
  • "Add apps"
  • Find an app in a list

Configuration

Environment variables:

Env Description Default
SLACK_TOKEN Bot User OAuth Access Token -
SLACK_SIGNING_SECRET Slack Signing Secret -
PIVOTAL_TOKEN Pivotal Tracker API token -
PORT HTTP port to listen 8080
STORIES_COUNT_TO_ASK Number of stories in a single message to start asking if needs to post preview 2

Deployment

Docker Compose

Edit ./configs/.env.prod file to add all required configuration parameters.

Then run:

$ docker-compose -f ./deployment/docker-compose.yml --env-file ./configs/.env.prod up -d

To update:

$ docker-compose -f ./deployment/docker-compose.yml pull
$ docker-compose -f ./deployment/docker-compose.yml --env-file ./configs/.env.prod up --no-deps -d web

About

Slack app that provides preview of the pivotal tracker stories when story URLs are posted to the channels.

Topics

Resources

Stars

Watchers

Forks