GitLab Server EE/CE Integration1
This feature tracks added or
deleted repositories from a remote GitLab server (EE/CE)
and automatically imports those Git repository references into Jira.
GitLab v10+ stopped accepting username/password credentials for API access and will only recognize
Personal Access Tokens (PAT) and OAuth authentications. Service users are strongly advised
to switch from using username/password for newer versions of GitLab Server (CE/EE) to using
Personal Access Tokens.
For GitLab Server service users, they won't see the issue until they upgrade their
GitLab Servers to version 10 and higher. Git Integration for Jira add-on offers
pre-v10 GitLab Server service users as a Legacy connection option.
BigBrassBand recommends a dedicated service user for this integration
which has access permissions to the GitLab git repositories.
Connecting to a GitLab Server Jira Cloud
This process requires an existing GitLab Server EE or GitLab Server CE. If your
GitLab Server version is 10.2 and newer, a personal access token must be configured.
- On the Jira Cloud dashboard menu, go to Git > Manage Git Repositories.
- The git configuration page for connecting repositories is displayed.
- On the Auto-connect integration panel, click GitLab.
- On the Connect to GitLab screen, select the External service from
the dropdown list.
The Advanced option is only available for GitLab Servers. Click
Advanced to expand the option to enter the query string parameters.
This setting is used with integration to retrieve list of tracked repositories.
Set a filter that will only load some cloned repositories which can be viewed
via Actions > Show tracked repositories in the Manage git
repositories configuration screen.
On the following screens, import detected repositories then configure
repository settings if required to complete the import process.
- GitLab Server (CE/EE) Legacy – if your GitLab
Server version is 10.1 and older.
Enter the Host URL of the GitLab server. Enter the username and password
credentials for server authentication. If 2FA is enabled in your GitLab Server, enter
the personal access token as the password.
- GitLab Server (CE/EE) – if your
GitLab Server version is 10.2 and newer.
Enter the Host URL of the GitLab server. Enter the username and PAT
credentials for server authentication. 2FA must be enabled in your GitLab Server and PAT
has been configured.
Currently the Git add-on scans only the repositories visible to the user
which is used for scanning. The repositories which are publicly
visible (shared for all members or visible to the member with the admin rights)
will not be scanned. This will be supported in a future release.
The GitLab server is added to the repositories list as a connected server
and is automatically reindexed.
Manage repositories of a connected GitLab server via the Git Repositories page under
Show tracked repositories to modify tracked repositories settings.
Repositories added or removed from GitLab server will be likewise added or removed from Jira Cloud.
The Git Integration for Jira add-on supports v3 and v4 of the GitLab API
(in both Jira Cloud and Jira Server).
For newer GitLab authentication - in order to access a Git repository
over HTTP, use the username as the username and the PAT for the password.
To pass the private access token (for example: XpigzF1JxMnAZ7mn9qgN) to an API call with GitLab.com:
curl --header "Private-Token: XpigzF1JxMnAZ7mn9qgN" https://gitlab.com/api/v4/projects?membership=true
Setting Up GitLab Server Web Links Jira Cloud
The Connect to GitLab wizard automatically configures the weblinks for the
connected GitLab server.
On the Issue page > Git Commits tab, the GitLab weblink should appear along
with the commitID and the commit files.