Linking GitLab accounts

On this page

Still need help?

The Atlassian Community is here for you.

Ask the community

You can link your GitLab and GitLab Enterprise accounts and their repositories to Jira, and see the development information from pull requests displayed in your issues.

Supported versions

Here’s a list of supported versions:

Jira versionGitLabGitLab self-managed
8.14+Current

13.0+

Before you begin: Integrate Jira with GitLab using OAuth 2.0

Before you can add your GitLab account to the page, you need to integrate Jira with GitLab using OAuth 2.0. In this case, you'll be configuring an outgoing link where Jira acts as the OAuth 2.0 client.

You need to be a Jira System Administrator to complete this task.

In Jira

To create an outgoing link:

  1. In the upper-right corner of the screen, select Administration  > Applications.

  2. Under Integrations, select Application links.
  3. Select Create link.

  4. Select External application > Outgoing link.

To configure the outgoing link:

  1. In service provider, select Custom.

  2. Enter your integration’s name.

  3. Don’t worry about the Client ID and Client secret right now. You’ll get them from GitLab in the next steps.

  4. Enter the authorization and token endpoint, as shown in the table below.

    GitLab typeAuthorization endpointToken endpoint
    GitLab.comhttps://gitlab.com/oauth/authorizehttps://gitlab.com/oauth/token
    GitLab self-managed<GITLAB_SELF_MANAGED_URL>/oauth/authorize<GITLAB_SELF_MANAGED_URL>/oauth/token
  5. Copy the Redirect URL. You’ll use it in GitLab in the next step. 

In GitLab

Leave your Jira configuration open and move to GitLab to create a new application. This will give you Application ID (Client ID in Jira) and Secret (Client secret) that you’ll use in Jira.

  1. In GitLab, go to User Settings > Applications, and add a new application. Use the following data:

    • Redirect URI: Enter the URL you copied from Jira.

    • Confidential: Keep that enabled.

    • Scopes: Select api. This is required for the connection to work.

  2. After creating the application, you should get the Application ID and Application Secret, like on the image below.

In Jira again

Go back to your configuration in Jira, and enter the missing information to complete the integration.

  1. Enter GitLab’s Application ID as Client ID.

  2. Enter GitLab’s Application Secret as Client secret.

  3. In Scopes, select api.

  4. Save the link. 

  5. In the GitLab authorization prompt, select Authorize.


Link your GitLab account

Use the outgoing link you created earlier to link your GitLab account on the accounts page in Jira:

  1. In the upper-right corner of the screen, select Administration  > Applications.

  2. Under Integrations, select DVCS Accounts.

  3. Select Link an account.

  4. In the Host dropdown, 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.

  5. In the Team or User Account, enter the target group and optional subgroups. 

    Requirements for entering groups and subgroups...
    • Groups must be entered as 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.

    • All spaces must be changed to dashes (-). For example, a group My projects needs to be my-projects. This also applies to subgroups: My Projects > More Projects would be my-projects/more-projects. Another way to get this right is to access your group on Gitlab, and copy the URL, for example http://gitlab.com/my-projects/more-projects.

  6. In the Client Configuration, select the outgoing link you created. If you have only one integration with GitLab, it will be automatically selected.

    Don't link multiple team or user accounts under the same client configuration (outgoing application link). Instead, make sure that each GitLab team and user account you link with Jira uses a separate client configuration.

  7. Select Add

What’s next?

Here’s what happens after adding your account:

  • Syncing repositories: Your account appears on the page and Jira starts syncing its repositories, if you decided to link them automatically. For details, see Integrating dev tools using .

  • Matching issues: If your commits and pull requests include issue keys, Jira will try to find them and add the relevant information to your issues. For details, see Referencing issues in your development work.

  • Displaying dev info: If referenced correctly, the dev information will be added to your issues to give everyone involved more context. For details, see Viewing the dev info for an issue.

  • Workflow triggers: One of the benefits of integrating your development tools is adding workflow triggers that, for example, lets you change the issue status after you create a new branch. For details, see Configuring workflow triggers.

Last modified on Nov 24, 2023

Was this helpful?

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