YouTrack InCloud 2021.3 Help

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 GitLabEntity in YouTrack
ProjectsProjects
IssuesIssues
EpicsIssues
Issue field valuesCustom field values
Wiki pagesArticles
CommentsComments
LabelsTags
Issue history

Issue activity items

Currently, history import is limited. For details, see Import Limitations.

UsersUsers
Attachments

Attachments

Currently, attachment import is limited. For details, see Import Limitations.

MilestonesValues of the Milestone custom field
Linked issuesIssue 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:

EntityDetails
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 attachments missing tag. YouTrack appends the list of missing attachments at the end of the issue description.

Historical eventsYouTrack imports historical events for Milestone, State and Weight fields only.
Work itemsWork items are not imported.
Issue fieldsYouTrack imports all issue fields except Iteration and Severity.
BoardsBoards 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.

    generate token in GitLab

  • Enter a name for the token.

  • Set the Scopes for the token. The import requires read_api and read_user scopes.

  • Click the Create personal access token button.

  • Copy the token to the clipboard.

    copy token in GitLab

Configure Import from GitLab in YouTrack

To configure import from GitLab:

  1. From the Administration menu, select Integrations > Imports.

  2. Click New import to open the setup dialog.

    New import dialog
  3. Select GitLab.

  4. Configure the import settings:

    GitLab import settings
    SettingDescription
    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.

    TokenThe 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.

  5. 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.

    Confirm settings and start import.
  6. 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.

    List of configured import projects.

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.

Import configuration details

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.

Project Mapping

To configure project mapping:

  1. 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.

  2. Select the projects that you want to import. Check the box on the top of the list to import all available GitLab projects.

  3. 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.

  4. If you want to change a target project, select another option from the corresponding dropdown on the list.

  5. Click Next to start import.

    • Import starts.

Edit Import Settings

To edit an existing import configuration:

  1. From the Administration menu, select Integrations > Imports.

  2. From the list of configured imports, select the one you need to edit.

    Details sidebar

  3. In the right sidebar, click the Edit in the toolbar.

  4. While in the edit mode, change the import settings, including the connection settings.

    Edit import 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.

  5. 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:

  1. From the Administration menu, select Integrations > Imports.

  2. From the list of configured imports, select the one you need to delete.

    Details sidebar

  3. Click the trash icon in the main toolbar of the page, or the Delete button in the right details sidebar.

  4. In the shown dialog, confirm the operation by clicking Delete.

    Confirm delete operation
    • The current import settings are removed.

    • Projects, issues, users, and groups that are already imported remain in YouTrack.

Last modified: 12 July 2021