Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
  1. Goto Settings → Webhooks in Gitlab project menu

  2. Select the event Issue Event

  3. Enter the URL: https://YOUR_USER:YOUR_PASSWORD@your_jira_base_url/rest/restfulintegrator/1.0/incoming/gitlab_issue

Note the URL is listed in the Inbound Integration Incoming Webooks page of iHub

change YOUR_USER:YOUR_PASSWORD to the integration user. Note the colon between

...

This will start sending issue events in this project to Jira and iHub

Repeat the steps above and select Comment as event but with the URL

  1. https://YOUR_USER:YOUR_PASSWORD@your_jira_base_url/rest/restfulintegrator/1.0/incoming/gitlab_comment

Manage the incoming request from Incoming Webhooks

  1. Navigate to Incoming Webhooks

  2. Click New Rule

  3. Name it GitLab

  4. Add a condition to the rule with operator ~ and value gitlab_issue

  5. Add Flow

  6. Add a condition with operator ~ and value gitlab_comment

  7. Save the rule

So far we have just added the rule, now we need to build the actions that receives the call.

Create a GitLab authentication

  1. Navigate to Credentials

  2. Select Custom Header

  3. Enter the name GitLab

  4. Click Create

  5. Add a new header with the following key/value

PRIVATE-TOKEN

generate token from Avatar->Edit Profile->Access Token and paste it in here in the value field

Add Actions in Integrations

  1. Click New (Action)

  2. Select Template Category: Jira Core

  3. Select Template: Create Issue

  4. Click Create

  5. Select a basic Auth Jira user see Basic Auth

  6. Add Body

    Code Block
    {
        "fields": {
            "project": {
                "id": "12200"
            },
            "summary": "{{object_attributes.title}}",
            "issuetype": {
                "id": "10001"
            },
            "reporter": {
                "name": "kg"
            },
            "labels": [
                "gitlab"
            ],
            "description":"{{object_attributes.description}}",
            "customfield_10201":"{{object_attributes.id}}"
        }
    }

This will create the issue based on the incoming data from GitLab

To be able to update or comment the issue we need to link them together using a labels on GitHub side to do this.

  1. Click New (Action)

  2. Select Template: application/json

  3. Click Create

  4. Select PUT as method

  5. Enter URL: https://gitlab.com/api/v4/projects/YOUR_PROJECT_ID/labels

  6. Select the GitLab header auth in the Authentication select list

  7. Add Body

Code Block
{
    "name":"{{key}}",
    "color":"#6699cc"
}