Linking a GitLab or GitLab Self-Managed repository with Jira

Use the Jira DVCS connector to link a GitLab (hosted or self-managed) account to Jira Software Server. When linked to Jira Software, branches, commit messages and pull requests are all seamlessly referenced in Jira Software issues. This allows Jira Software to display information about your development activity in the corresponding issue.

Connecting Jira Software to GitLab

The connector needs permission from your DVCS account to access your account data. The connector does this through an OAuth 2 access token.

Add an OAuth 2.0 integration for your GitLab integration to use

For more information on OAuth 2.0 in Jira, see Integrating with OAuth 2.0.

To add a new OAuth 2.0 integration in Jira:

  1. Go to Administration > System > OAuth 2.0.

  2. Select Add new integration.

  3. Select Custom.

  4. Enter your integration’s name.

  5. Enter the authorization and token endpoint:

  6. Keep the form open, and use the generated redirect URL to create the OAuth 2.0 configuration in GitLab. For more info on how to do this, see OAuth service provider. Things to keep in mind when creating the configuration in GitLab:
    • Apply the api scope
    • Keep Confidential enabled

  7. Back in Jira, apply the following data generated in GitLab:
    • Application ID as Client ID
    • Application Secret as Client Secret

  8. Save the Jira OAuth 2.0 integration, and select Test Connection to ensure the setup is complete.


Using the OAuth 2.0 integration in DVCS

To use the OAuth 2.0 integration you created in DVCS:

  1. In Jira, go to Administration > Applications > DVCS Accounts.

  2. Click Link an account.

  3. In the Host drop-down, select GitLab or GitLab Self-Managed.
    • For GitLab Self-Managed, enter your GitLab Host URL.
    • For Gitlab, the Host URL is fixed to https://gitlab.com.

  4. In the Team or User Account, enter the target group and optional subgroups.
    • This is in the form of groupA/sub-groupA/sub-sub-groupA. 

      You can only have one group active as a configuration at one time. For example:

      - If an existing integration is already using groupA, you won't be able to use groupA/sub-groupA in your new integration.

      - Likewise, if an existing integration is using groupA/sub-groupA, you won't be able to use groupA in your new integration.



  5. In the Client Configuration, select the created OAuth 2.0 integration. If you have only one, it will be automatically selected.

  6. Click Add.
Last modified on Jan 25, 2021

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.