This little webhook pushes GitLab events directly to Jira, so they are displayed in Jira tickets as remote links to the GitLab Merge Request.
In Jira it looks like this:
.env:
GITLAB_PERSONAL_ACCESS_TOKEN=jashdjsahdsjadsas
GITLAB_BASE_URL=https://git.example.org
GITLAB_WEBHOOK_TOKEN=TheToken
JIRA_BASE_URL=https://jira.example.org
JIRA_USERNAME=jirauser
JIRA_PASSWORD=thepassword
.env:
GITLAB_PERSONAL_ACCESS_TOKEN=jashdjsahdsjadsas
GITLAB_BASE_URL=https://git.example.org
GITLAB_WEBHOOK_TOKEN=TheToken
JIRA_PFX_PATH=./user_key.p12
JIRA_PFX_PASSWORD=ThePassword
JIRA_BASE_URL=https://jira.example.org
If you need to setup a https proxy, use:
JIRA_HTTPS_PROXY=http://username:password@proxy.example.org:3128
$ npm install
$ npm start
$ docker run --rm --env-file .env -p80:3000 dracoblue/gitlab-jira-webhook
- Set URL to http://example.org/events if your Webhook runs on http://example.org.
- Set the token to something, which you will configured in
GITLAB_WEBHOOK_TOKEN
.
Now your merge requests should be visible whenever your reference a ticket with TEST-1234 at the ticket.
By default all icons will be loaded from https://raw.githubusercontent.com/webdog/octicons-png/master/black/*
.
If you want to override the file, configure it with the ICON_URL_PATH
and store the file
icon-url-map.json
of this repository at a different place next to the storage.
- Jira: Jira shows only the last 5 (remote) links for an issue
- Thus you shouldn't add too many merge requests to one Ticket
- GitLab: If on first push the merge is conflicted: the merge event does not appear!
- Thus we fetch the merge request again as soon as a pipeline finishes.
This work is copyright by DracoBlue (http://dracoblue.net) and licensed under the terms of MIT License.