Slack bot for color environemnt assignment by JIRA tickets.
-
Go to https://my.slack.com/apps/new/A0F7YS25R-bots and pick a name for your new bot. (make sure you are in the right workspace)
-
Once you’ve clicked “Add integration,” you’ll be taken to a page where you can further customize your bot. Of importance is the bot token—take note of it now.
-
Once you have the token, create a
.env
file and inside put your token:TOKEN=xoxb-your-token-here
-
Make sure to set the other
.env
variables:JIRA_USERNAME=jira-username-here JIRA_PASSWORD=jira-password-here JIRA_HOST=jira-host-here JIRA_PORT=jira-port-here JIRA_HOST_PROTOCOL=jira-host-protocol-here
-
Execute:
npm install
-
Execute:
npm start
-
Invite the bot to one of the channels and start communicate with it.
Used with simple wildcard regex:
Mention the bot (e.g. @color-bot
) and then type one of the following:
- assigning a new color with jira ticket:
use (.*) ticket (.*)
color (.*) ticket (.*)
use (.*) jira (.*)
color (.*) jira (.*)
- releasing color env (must be made by the owner of the first assignment):
release (.*)
free (.*)
done (.*)
If you wish to use docker, simply run the following commands from within the repo folder:
- Build
docker build -t color-bot .
- Run
docker run -v PATH-TO-REPO-FOLDER/db_slack_bot_ci:/db_slack_bot_ci color-bot
- use mongo instead of volume filesystem
- cron jobs for JIRA to check every day if holding person is still working on that ticket by private convo from bot to user
- cron jobs to check every other min status of the holding JIRA tickets and automatically free relevant color envs if JIRA ticket status is DONE/FINISHED/RESOLVED etc..
- add more cool features that may be useful :)