GitLab JIRA development panel integration

Introduced in GitLab Premium 10.0.

As an extension to our existing JIRA project integration, you’re now able to integrate GitLab projects with JIRA Development Panel. Both can be used simultaneously. This works with self-hosted GitLab or GitLab.com integrated with self-hosted JIRA or cloud JIRA.

By doing this you can easily access related GitLab merge requests, branches, and commits directly from a JIRA issue.

This integration connects all GitLab projects within a top-level group or a personal namespace to projects in the JIRA instance. A top-level GitLab group is one that does not have any parent group itself. All the projects of that top-level group, as well as projects of the top-level group’s subgroups nesting down, are connected. Alternatively, you can specify a GitLab personal namespace in the JIRA configuration, which will then connect the projects in that personal namespace to JIRA.

(Note this is different from the existing JIRA project integration, where the mapping is one GitLab project to the entire JIRA instance.)

We recommend that a GitLab group admin or instance admin (in the case of self-hosted GitLab) set up the integration with respect to their account, in order to maximize the integrated GitLab projects used by your team.

Requirements

Self-hosted GitLab

If you are using self-hosted GitLab, make sure your GitLab instance is accessible by JIRA.

  • If you are connecting to JIRA Cloud, make sure your instance is accessible via the internet.
  • If you are using JIRA Server, make sure your instance is accessible however your network is set up.

GitLab.com

There are no special requirements if you are using GitLab.com

GitLab Configuration

  1. In GitLab, create a new application in order to allow JIRA to connect with your GitLab account

    While logged-in, go to Settings -> Applications. (Click your profile avatar at the top right, choose Settings, and then navigate to Applications from the left navigation menu.) Use the form to create a new application.

    Enter a useful name for the Name field.

    For the Redirect URI field, enter https://<your-gitlab-instance-domain>/login/oauth/callback, replacing <your-gitlab-instance-domain> appropriately. So for example, if you are using GitLab.com, this would be https://gitlab.com/login/oauth/callback.

    Note: If using a GitLab version earlier than 11.3 the Redirect URI value should be https://<your-gitlab-instance-domain>/-/jira/login/oauth/callback.

    GitLab Application setup - Check api in the Scopes section.

  2. Click Save application. You will see the generated ‘Application Id’ and ‘Secret’ values. Copy these values that you will use on the JIRA configuration side.

JIRA Configuration

  1. In JIRA, from the gear menu at the top right, go to Applications. Navigate to DVCS accounts from the left navigation menu. Click Link GitHub account to start creating a new integration. (We are pretending to be GitHub in this integration until there is further platform support from JIRA.)

    JIRA DVCS from Dashboard

  2. Complete the form

    Select GitHub Enterprise for the Host field.

    For the Team or User Account field, enter the relative path of a top-level GitLab group that you have access to, or the relative path of your personal namespace.

    Creation of Jira DVCS integration

    For the Host URL field, enter https://<your-gitlab-instance-domain>/, replacing <your-gitlab-instance-domain> appropriately. So for example, if you are using GitLab.com, this would be https://gitlab.com/.

    Note: If using a GitLab version earlier than 11.3 the Host URL value should be https://<your-gitlab-instance-domain>/-/jira

    For the Client ID field, use the Application ID value from the previous section.

    For the Client Secret field, use the Secret value from the previous section.

    Ensure that the rest of the checkboxes are checked.

  3. Click Add to complete and create the integration.

    JIRA takes up to a few minutes to know about (import behind the scenes) all the commits and branches for all the projects in the GitLab group you specified in the previous step. These are refreshed every 60 minutes.

    Note: In the future, we plan on implementating real-time integration. If you need to refresh the data manually, you can do this from the Applications -> DVCS accounts screen where you initially set up the integration:

    Refresh GitLab information in JIRA

To connect additional GitLab projects from other GitLab top-level groups (or personal namespaces), repeat the above steps with additional JIRA DVCS accounts.

You may now refer any Jira issue by its ID in branch names, commit messages and merge request names on GitLab’s side, and you will be able to see the linked branches, commits, and merge requests when entering a JIRA issue (inside the Jira issue, merge requests will be called “pull requests”).

Branch, Commit and Pull Requests links on JIRA issue

Click the links to see your GitLab repository data.

GitLab commits details on a JIRA issue

GitLab merge requests details on a JIRA issue

Limitations

  • This integration is currently not supported on GitLab instances under a relative url (e.g. http://example.com/gitlab).