Integration Guide

gitlab logo Integration1 Jira Cloud


Acquiring URL

This process requires an existing GitLab git repository.  For starters, the GitLab repository URL can be acquired on the repository project page.  Choose between SSH or HTTPS.

GitLab repository home

Use this information to connect the GitLab git repository to your Jira Cloud via Git Integration for Jira add-on: Manage Git Repositories > Connect to Git Repository.

helpful tip
The Git Integration for Jira add-on supports v3 and v4 of the GitLab API (in both Jira Cloud and Jira Server).

Connecting to a Account

This process requires an existing account.  Multiple git repositories in a account will be connected via Git Integration for Jira add-on.

GitLab introduced personal access tokens (PAT) since version 8.8 and now (v10+) prefers this type of authentication for accessing the git repositories.  Service users are strongly advised to switch from using username/password to using Personal Access Tokens (PAT) for

While instructions from GitLab works just fine, here are some specific instructions to get you up and running.

Creating a Personal Access Token

  1. Login to your GitLab account then go to your Profile Settings.
  2. Select Access Tokens on the sidebar.  The following screen is displayed:
  3. GitLab MFA generate access token
  4. Give the token a descriptive name. (For example, "Git Integration for Jira")
  5. Leave the Expires at field blank.
  6. Select the "api" scope.
  7. Click Create personal access token.
  8. Copy the token – (Write it down or be sure to save it. This is the ONLY time you'll see the token).

Connecting Git Repositories to Jira Cloud

  1. Go to Manage Git Repositories (Dashboard > Git menu) in Jira Cloud.
  2. Click GitLab in the Auto-connect integration panel.
  3. is selected by default.  Paste the personal access token in the provided field.
  4. Connect to Authentication screen
  5. Follow instructions in the wizard to import GitLab repositories.

There will be a slight delay in adding this repository compared to others.  It will show in the git configuration list eventually.

helpful tip
To pass the private access token (for example: XpigzF1JxMnAZ7mn9qgN) to an API call with
curl --header "Private-Token: XpigzF1JxMnAZ7mn9qgN"
In order to access a Git repository over HTTP, use the username as the username and the PAT for the password.

Working with Branches and Pull Requests with GitLab Jira Server

This process requires a GitLab git repository and a PAT with api scope.

For GitHub Organization, the user must have the Write permissions and the api PAT scope.

  1. On your Jira Server, open a Jira issue.  On the Jira developer panel under Git Source Code, click Create Branch.
  2. The following dialog is displayed:
  3. Jira server issue page create branch dialog
    • Select a Repository from the list.
    • Choose a Base branch.
    • Enter a Branch name or leave it as is (recommended).
  4. Click Create Branch.  The newly-created branch is now listed in the developer panel under Branches.

Perform a commit to the newly-created branch to be ready for merge.

Merge Request

The pull request feature works the same as merge request.

To create a merge request and merge it to the main source (master):

  1. On your Jira Server, open the Jira issue where your previously created a branch.
  2. On the developer panel under Git Source Code, click Create merge request.
  3. The following dialog is displayed:
  4. Jira issue page create pull request dialog
    • Select Repository from the list.
    • Choose the newly-created branch as the Source branch.
    • Set master as the Target branch.
    • Enter a descriptive title or leave it as is (recommended).
  5. Click Create to create the merge request.

The merge request is listed on the developer panel of the Jira issue page.

The merge request is also ready for approval by the reviewers in your GitLab web portal.