Import from GitLab
The new option to import data from GitLab lets you migrate data from a GitLab project including issues, comments, and users.
In essence, an import configuration is a graphic UI representation of an import script. A setup wizard navigates you through the import configuration process, which covers standard issue settings in GitLab. If your project has any custom settings, you can use an option to directly edit the client GitLab import script in YouTrack itself.
Prerequisites
Your GitLab version is 13.8 or later.
Your GitLab server is accessible to inbound connections. Specifically, you need to make sure that your network doesn't block requests from YouTrack to GitLab.
The account that you use to connect to GitLab has access to the GitLab project that you want to import. This is the user account whose private access token is used for authentication.
Import Details
If the GitLab database contains references to entities that do not already exist in YouTrack, they are created. The YouTrack user account that you use to run the import should have permissions to create all imported entities. We recommend that you use an account with a System Admin role or the Low-level Admin Write permission to run the import.
Imported Entities
Here is the list of entities that are imported from GitLab and their mapping to YouTrack entities:
Entity in GitLab | Entity in YouTrack |
---|---|
Projects | Projects |
Issues | Issues |
Epics | Issues |
Issue field values | Custom field values |
Wiki pages | Articles |
Comments | Comments |
Labels | Tags |
Issue history | Issue activity items Currently, history import is limited. For details, see Import Limitations. |
Users | Users |
Attachments | Attachments Currently, attachment import is limited. For details, see Import Limitations. |
Milestones | Values of the Milestone custom field |
Linked issues | Issue links |
Import Limitations
Due to GitLab and YouTrack API limitations, YouTrack imports some entities partially or doesn't import at all. The following import limitations are in place:
Entity | Details |
---|---|
Attachments | Only image attachments in issues are imported. In some cases, image attachments in articles can also be imported. Each issue with a missing attachment will be marked with the |
Historical events | YouTrack imports historical events for Milestone , State and Weight fields only. |
Work items | Work items are not imported. |
Issue fields | YouTrack imports all issue fields except Iteration and Severity . |
Boards | Boards are not imported. |
Set up an Import from GitLab
Before you add a new import configuration, you need to create a personal access token that will grant access to the target project in GitLab. Then you can use the token for authorization when setting up the import in YouTrack.
Create an Access Token in GitLab
To set up import of issues from GitLab, you must preliminary create a personal access token for the GitLab account that you use to access issues in the GitLab project.
To create a Personal Access Token in GitLab, follow these steps:
Click the Generate token link to open the Personal Access Tokens page in GitLab.
Enter a name for the token.
Set the Scopes for the token. The import requires
read_api
andread_user
scopes.Click the Create personal access token button.
Copy the token to the clipboard.
Configure Import from GitLab in YouTrack
To configure import from GitLab:
From the Administration menu, select .
Click New import to open the setup dialog.
Select GitLab.
Configure the import settings:
Setting Description GitLab URL The URL of your GitLab.
If your instance is hosted on gitlab.com, enter the project URL. For self-managed installations, enter the base URL instead.
Token The personal access token that you have generated in GitLab for the user account that you use to access the target issues. If required by your GitLab installation, enable the Use SSL key for client authentication option.
When done, click Next.
Review the settings that you have provided.
If your GitLab is self-managed, you'll need to configure project mapping for the import. For details, see Project Mapping.
Optionally, enable the Continuous import. When enabled, YouTrack will periodically poll the GitLab project and import updates that were made since the last sync.
When done, click Start import.
YouTrack will create a project of the same name as the target project in GitLab, and import found issues, articles, and users.
If you have configured a project mapping, YouTrack will create new projects and import data to the existing ones according to the mapping.
If the Continuous import option is enabled, YouTrack will periodically check target GitLab projects for updated and new issues.
When you have set up an import, it is shown in the imports list. To view configuration and import details, select the import configuration from the list.
In the details sidebar, YouTrack shows import status and details on the data that was imported. Click the Resume button in the toolbar to explicitly start polling for changes and importing updates from the target GitLab project.
You can also download the import log file to study and investigate when needed.
Project Mapping
If your GitLab is self-managed, you can import multiple projects from GitLab to YouTrack within one import configuration.
On the final step of the import setup, you have an option to select those projects that you want to import to YouTrack. You can also choose whether to create a new project for the import or import data into an existing project in YouTrack.
To configure project mapping:
Locate those GitLab projects that you want to import. Note that the GitLab project names on the list include the name of the group they belong to.
Use the filter bar on the right to filter projects by name.
Select the projects that you want to import. Check the box on the top of the list to import all available GitLab projects.
Select a target YouTrack project for each GitLab project.
When loading the list of GitLab projects for mapping, YouTrack checks for existing YouTrack projects with corresponding names. If it finds a YouTrack project with the same name as the GitLab one, YouTrack suggests it as the target project.
If there is no existing YouTrack project with the corresponding name, YouTrack suggests creating a new one.
If you want to change a target project, select another option from the corresponding dropdown on the list.
Click Next to start import.
Import starts.
Edit Import Settings
To edit an existing import configuration:
From the Administration menu, select .
From the list of configured imports, select the one you need to edit.
In the right sidebar, click the Edit in the toolbar.
While in the edit mode, change the import settings, including the connection settings.
Click the customize the import script link at the bottom of the page to make changes to the script. For details, refer to the Developer Portal.
When ready, click Resume import.
Your changes will be applied, and YouTrack will poll the target GitLab project for the updates.
Delete the Import Configuration
To delete an existing import configuration:
From the Administration menu, select .
From the list of configured imports, select the one you need to delete.
Click the trash icon in the main toolbar of the page, or the Delete button in the right details sidebar.
In the shown dialog, confirm the operation by clicking Delete.
The current import settings are removed.
Projects, issues, users, and groups that are already imported remain in YouTrack.