This slack bot will listen on any channel it's on for JIRA tickets. It will lookup the ticket and respond with some information about it.
- Clone this repository
npm install
- Copy
./config.default.js
to./config.js
and fill it out npm start
npm install
(make sure your NODE_ENV !=production
)npm test
The config file should be filled out as follows:
-
jira:
- protocol: string, https or http
- host: string, the host or fqdn for JIRA (jira.yourhost.domain)
- port: integer, the port JIRA is on, usually 80 or 443
- base: string, If JIRA doesn't sit at the root, put its base directory here
- user: string, Username of JIRA user
- pass: string, Password of JIRA user
- apiVersion: string, API version slug, usually latest
- strictSSL: boolean, set false for self-signed certificates
- regex: string, a string that will be used as a RegExp to match tickets, defaults to '([A-Z][A-Z0-9]+-[0-9]+)'
- sprintField: string, If using greenhopper, set the custom field that holds sprint information (customfield_1xxxx)
- response: string, If 'full'(default), it will display all fields in response. 'minimal' just shows title/description
- customFields:
- Add any custom fields you would like to display
- customfield_1xxxx: "Custom Title"
- Object notation is supported
- "customfield_1xxxx.member": "Custom Title"
- "customfield_1xxxx[0].member": "Custom Title"
-
slack:
- token: string, Your slack token
- autoReconnect: boolean, Reconnect on disconnect
-
usermap:
- Map a JIRA username to a Slack username
- "jira-username": "slack-username"
Build an image using docker build -t your_image:tag
Official Image shaunburdick/slack-jirabot
You can set the configuration of the bot by using environment variables. ENVIRONMENT_VARIABLE=Default Value
- JIRA_PROTOCOL=https, https or http
- JIRA_HOST=jira.yourdomain.com, hostname for JIRA
- JIRA_PORT=443, Usually 80 or 443
- JIRA_BASE= , If JIRA doesn't sit at the root, put its base directory here
- JIRA_USER=username, Username of JIRA user
- JIRA_PASS=password, Password of JIRA user
- JIRA_API_VERSION=latest, API version slug
- JIRA_VERBOSE=false, Verbose logging
- JIRA_STRICT_SSL=false, Set to false for self-signed certificates
- JIRA_REGEX=([A-Z0-9]+-[0-9]+), The regex to match JIRA tickets
- JIRA_SPRINT_FIELD=, if using greenhopper, set the custom field that holds sprint information (customfield_xxxxx)
- JIRA_RESPONSE=, If 'full' (default), it will display all fields in response. 'minimal' just shows title/description
- SLACK_TOKEN=xoxb-foo, Your Slack Token
- SLACK_AUTO_RECONNECT=true, Reconnect on disconnect
Set them using the -e
flag while running docker:
docker run -it \
-e JIRA_HOST=foo.bar.com \
-e JIRA_USER=someuser \
-e JIRA_PASS=12345 \
-e SLACK_TOKEN=xobo-blarty-blar-blar \
shaunburdick/slack-jirabot:latest
- Create a new branch, please don't work in master directly.
- Add failing tests for the change you want to make (if appliciable). Run
npm test
to see the tests fail. - Fix stuff.
- Run
npm test
to see if the tests pass. Repeat steps 2-4 until done. - Update the documentation to reflect any changes.
- Push to your fork and submit a pull request.