GitLab
In Yandex Tracker issues, you can automatically add links to commits from GitLab. To do this, specify the appropriate issue's key in the commit comment. The links will be placed on the Commits tab. For more information, see How to link a commit to an issue.
Connecting a repository
To connect your repository on GitLab to Yandex Tracker:
Private repositories can only be accessed by users logged in to GitLab (Internal project) or the project team (Private project).
-
Make sure you are authorized in Tracker as an administrator.
-
In the left panel, click
→ Administration. Next, open Repositories and click Connect. -
Choose GitLab in the Platform field.
-
Get an OAuth token for your repository on GitLab. For details on how to get a token, see the GitLab documentation. For the proper operation of Yandex Tracker, enable the read_repository and read_api options when setting up permissions.
-
Enter the repository address as
https://github.com/<repository_owner_login>/<repository_name>
and specify the access token. -
Click Connect.
-
Make sure that the repository status in Yandex Tracker is Connected.
Own server
To connect your own server to Tracker:
-
Make sure you are authorized in Tracker as an administrator.
-
In the left panel, click
→ Administration. Next, open Repositories and click Connect. -
In the Platform field, select the service your server is connected to.
-
In the Link to repository field, specify the URL of the repository on your server. Make sure that you connect to the server using the OAuth 2.0 technology.
-
Get an OAuth token for your repository.
-
In the Token field, enter the OAuth token for connecting to your server.
-
Click Connect.
-
Make sure that the repository status in Tracker is Connected.
For instructions on how to obtain an OAuth token, see the GitLab documentation. For the proper operation of Yandex Tracker, enable the read_repository and read_api options when setting up permissions.
Setting up links to merge requests
In Yandex Tracker issues, you can automatically add links to GitLab merge requests by specifying the appropriate issue key in the name or description of a new merge request. The links will be placed in Links to external applications.
You can also enable automatic creation of issue comments with information about merge requests. Auto comments are only available when using Managed Service for GitLab.
Create a hook for integration
To link GitLab merge requests to Tracker issues, create a hook:
-
If you do not have an OAuth token for working with the Tracker API yet, get one.
-
Check if you have access to the API by requesting information about the current user.
-
Open a GitLab instance and go to the hook settings:
- To enable integration for the entire GitLab instance (GitLab admin privileges are required):
- In the left panel, click the Your work drop-down list and select Admin Area.
- Go to System Hooks.
- To enable integration for an individual project:
- Go to the project you need.
- In the left panel, click Settings and select Webhooks.
- To enable integration for the entire GitLab instance (GitLab admin privileges are required):
-
Specify the hook parameters:
-
URL:
https://api.tracker.yandex.net/v2/system/gitlab/receive?comments=true&x_org_id=<organization_ID>
Where:
-
comments=true
: Enables automatic creation of comments in an issue with a link to and information about merge requests. Disable it if commenting is not required. This parameter is only available for Managed Service for GitLab. -
<organization_ID>
To get the organization ID, go to Administration → Organizations and copy the value from the ID field.
-
-
Secret token: OAuth token of the bot that will be used to add the links, in
OAuth <token_contents>
format.
For example:OAuth y1_AQAD-qJScAAAEKEQbBNnChvfBIqR_yEQl_HMO0********
. -
In the Trigger section, disable all options except Merge request events.
-
In the SSL verification section, select Enable SSL verification.
-
-
Click Add system hook (Add webhook for an individual project).
The System Hooks (Project Hooks for an individual project) section with information about the created hook and its parameters will appear on the page.
Test the hook
- Click Test under System Hooks (Project Hooks for an individual project).
- Select Merge request events from the drop-down list.
A test request should return a response saying Hook executed successfully: HTTP 204
. If the test request returns an error, the hook parameters are incorrect.