This tool offers a simple but monitored way to check a given filter for issues and send a webhook message to your mattermost server if a new one appears in the list.
Example usecase: Monitoring and alerting for high and medium priority tickets within a Jira Servicedesk queue.
If there's a feature missing for you, just let me know via a feature request
I would consider this bot to be in it's beta phase at the moment. The first version after that will be 1.0.0 until then I wouldn't recommend to use it in production.
Since this tool is currently still under development, some assumptions had to be made:
- You use a current, on premise version of Jira which still supports password based api login
- You have a user able to use the Jira api
- You want to be notified via a message in a Mattermost channel
- You are allowed to query your Jira api every ~20s
Most of the assumptions above are subject to change, when those values will become configurable.
The following values have to be present inside a .env file inside the application directory.
Key | Value |
---|---|
JIRA_USERNAME | The username the application will use to query Jira (required) |
JIRA_PASSWORD | The corresponding password the application will use to query Jira (required) |
JIRA_FILTER_ID | The numeric ID of the filter the application will query (required) |
JIRA_URL | The base url of the Jira instance that should be queried (required) |
JIRA_CHECK_INTERVAL | The numeric interval in seconds in which Jira will be queried (required) |
WEBHOOK_ULR | The mattermost webhook that should be notified when an alert happens (required) |
PROMETHEUS_PORT | The numeric port on which the Prometheus endpoint will be available (use 2112 if unsure) (required) |
Besides the .env file you can supply the --NoInitialPost
command line argument to prevent the bot from posting the issues which are in the filter at the beginning.
At the current point in time no prebuild packages are offered, but you can build the application from source.
- Checkout the project via git
- Install a current version of Go (latest version testet: go1.15.5)
- Navigate your terminal into the project directory
- Install all dependencies via
go get
- Build the application via
go build
- Start the new executable generated by the go compiler :)
By default, the application offers an /metrics
endpoint at port 2112. (http://localhost:2112/metrics) This endpoint can
be used by a prometheus server to keep taps on this application.
The following (in no particular order) things should be done to improve this application:
- Add more configurable values
- Auto recovery when connection to Mattermost or Jira failed
- Add link to issue to Mattermost notification
- Moving to machine-readable logging
- Make the application able to run inside a container (Docker)
- Add Microsoft Teams support
- Add Slack support
- Add support for OAuth / Token based authentication for jira
- publish issue Counter via Prometheus to display it on Graphana dashboards
- Split the application in smaller chunks
- Buy Elrathor some cookies