You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Intro

It is necessary to understand basic principles. There is either generic Git support with basic Git functionalities but without any advanced integrations like merge requests, branches and so on.

You have to choose proper way based on available options. If Gitlab is hosting intended repositories, you shall use Gitlab auto-connect in Jira Git plugin. Use generic Git connect only in custom and edge cases.

Recommended setup:

  • service account available for integration purposes

    Personal accounts are NOT recommended because integrations usually fail when person changes credentials or leaves the project/company.

  • do not use service accounts with huge amount of repositories access as the sync can/will use lot of Jira server storage
  • in case of custom/generic repositories limit the projects that will use every specific repository otherwise it can be security issue

Gitlab repositories integration

How does it work:

  • service account needs to be created in Gitlab
  • personal access token must be generated for that service account in Gitlab
  • access to proper repositories must be granted to this service account

Steps:

  • Add service account into proper repositories using portal
  • Go to Gitlab users list https://gitlab.shared.CUSTOMERX.tds.tieto.com/admin/users
  • Search for that service account and open it by clicking username or simply go to user profile using this direct link while replacing XXX with username - https://gitlab.shared.CUSTOMERX.tds.tieto.com/admin/users/XXX
  • Click "Impersonate"
  • Then go to Personal Access Tokens page https://gitlab.shared.CUSTOMERX.tds.tieto.com/profile/personal_access_tokens
  • Fill the name , for example like "jira-integration"
  • Leave Expires at EMPTY to keep it unlimited
  • Choose "read_user, read_api, read_repository, write_repository"
  • Then stop impersonation
  • Go to https://jira.shared.CUSTOMERX.tds.tieto.com/secure/ViewGitRepositories.jspa
  • Click Gitlab in auto-connect options
  • Provide Gitlab URL
  • Enter access token generated in previous step
  • Click Next and check loaded projects/repositories list to see whether accesses are correct and make sure to fix it
  • Click Continue
  • Untick "Associate with all projects" and choose proper Jira projects to map selected repositories to
    • Or enable PAT for users interactions with Gitlab which is even better but can be very confusing and complex for users
  • Click Finish
  • Find newly created integration
  • Click gear next to it and select "Edit integration connection settings"
  • Change "Display Name" from Gitlab URL to service account username and something which represents that integration, usually portal project name, for example "srv123abc - MyPortalProject"
  • Click Update

Generic Git repositories integration

TODO later by someone else (big grin)

  • No labels