English | ไธญๆ
A GitLab webhook to trigger Jira issue transition when merge request events occurred.
This is a webhook for connection of GitLab and Jira.
Inspired by shyiko/gitlab-ci-build-on-merge-request.
- Build & Run
git clone https://github.com/kingcos/gitlab-mr-jira-issue-trigger.git
cd gitlab-mr-jira-issue-trigger
go build gitlab-mr-jira-issue-trigger.go
./gitlab-mr-jira-issue-trigger --path <CONFIG_YAML_FILE_PATH(Default is `config.yml`)>
- or Docker
git clone https://github.com/kingcos/gitlab-mr-jira-issue-trigger.git
- Add your
config.yml
ingitlab-mr-jira-issue-trigger
folder - Update
EXPOSE
settings in theDockerfile
(Same as Server - Port inconfig.yml
)
docker build -t kingcos/gitlab-mr-jira-issue-trigger .
docker run -p 9000:<YOUR_DEFINED_PORT> -it --rm --name gitlab-mr-jira-issue-trigger \
kingcos/gitlab-mr-jira-issue-trigger:latest \
gitlab-mr-jira-issue-trigger
- Add server IP with port & path which you setup in config.yml in the GitLab - Settings - Integrations page:
- Click 'Add webhook' button
- You can test it with 'Merge requests events'
GitLab:
host: GITLAB_HOST_ADDRESS (REQUIRED)
token: GITLAB_PUBLIC_USER_TOKEN (REQUIRED)
Jira:
host: JIRA_HOST_ADDRESS (REQUIRED)
username: JIRA_PUBLIC_USERNAME (REQUIRED)
password: JIRA_PUBLIC_PASSWORD (REQUIRED)
Server:
path: WEBHOOK_SERVER_PATH (REQUIRED)
port: WEBHOOK_SERVER_PORT (REQUIRED)
Trigger:
regex:
- REGEX_FOR_MATCH_JIRA_ISSUE_IDS_IN_GITLAB_MERGE_REQUEST_TITLE_1
- REGEX_FOR_MATCH_JIRA_ISSUE_IDS_IN_GITLAB_MERGE_REQUEST_TITLE_2
opened:
title: JIRA_TRANSITION_TITLE_IN_THE_PAGE
message: JIRA_ISSUE_MESSAGE
url: SHOULD_INCLUDED_GITLAB_MERGEREQUEST_URL
date: SHOULD_INCLUDED_GITLAB_MERGEREQUEST_DATE
username: SHOULD_INCLUDED_GITLAB_MERGEREQUEST_USERNAME
merged:
title: JIRA_TRANSITION_TITLE_IN_THE_PAGE
message: JIRA_ISSUE_MESSAGE
url: SHOULD_INCLUDED_GITLAB_MERGEREQUEST_URL
date: SHOULD_INCLUDED_GITLAB_MERGEREQUEST_DATE
username: SHOULD_INCLUDED_GITLAB_MERGEREQUEST_USERNAME
closed:
title: JIRA_TRANSITION_TITLE_IN_THE_PAGE
message: JIRA_ISSUE_MESSAGE
url: SHOULD_INCLUDED_GITLAB_MERGEREQUEST_URL
date: SHOULD_INCLUDED_GITLAB_MERGEREQUEST_DATE
username: SHOULD_INCLUDED_GITLAB_MERGEREQUEST_USERNAME
locked:
title: JIRA_TRANSITION_TITLE_IN_THE_PAGE
message: JIRA_ISSUE_MESSAGE
url: SHOULD_INCLUDED_GITLAB_MERGEREQUEST_URL
date: SHOULD_INCLUDED_GITLAB_MERGEREQUEST_DATE
username: SHOULD_INCLUDED_GITLAB_MERGEREQUEST_USERNAME
- If you find bugs, please issue me
- If you want to contribute, please pull request
- If you like it, just star ๐ it