doc/user/import/third_party_systems/jira.md
{{< details >}}
{{< /details >}}
If you use Jira, you can either:
| Migration option | Description |
|---|---|
| GitLab Professional Services | Have GitLab Professional Services perform the migration for you. |
Jira2Lab | Use Jira2Lab, the GitLab Professional Services fork of jira2gitlab. |
| Third-party script | For example, use jira2gitlab for the migration. |
| Jira importer | Use the Jira importer that is built into GitLab. |
| CSV file import | Use a CSV file to move data from Jira to GitLab. |
| Your own script | Write your own script that uses the GitLab REST or GraphQL API. |
| Third-party service | Use a third-party service that keeps GitLab and Jira synchronized, such as those from Unito and Getint. |
Using the Jira importer, you can import your Jira issues to GitLab. Issues from multiple Jira projects can be imported into a GitLab project. GitLab imports the issue's title, description, and labels directly. You can also map Jira users to GitLab project members when preparing for the import.
Other Jira issue metadata that is not formally mapped to GitLab issue fields is imported into the GitLab issue's description as plain text.
Text in Jira issues is not parsed to GitLab Flavored Markdown, which can result in broken text formatting. For more information, see issue 379104.
Epic 2738 proposes the addition of issue assignees, comments, and other improvements to the GitLab Jira importer.
Importing Jira issues is done as an asynchronous background job, which can result in delays based on:
Importing large projects can take several minutes depending on the size of the import.
To import Jira issues to a GitLab project:
On the {{< icon name="work-items" >}} Work items page, select Actions ({{< icon name="ellipsis_v" >}}) > Import from Jira.
Select the Import from dropdown list and select the Jira project that you wish to import issues from.
In the Jira-GitLab user mapping template section, the table shows to which GitLab users your Jira users are mapped. When the form appears, the dropdown list defaults to the user conducting the import.
To change any of the mappings, select the dropdown list in the GitLab username column and select the user you want to map to each Jira user.
The dropdown list may not show all the users, so use the search bar to find a specific user in this GitLab project.
Select Continue. You're presented with a confirmation that the import has started.
While the import is running in the background, you can go to the Work items page to see the new issues (work items of type Issue) appearing in the list.
To check the status of your import, go to the Jira import page again.
To import your Jira issue data from a CSV file into your GitLab project:
title, description, due_date, and milestone are imported.For full control over the migration process, you can write your own custom script that migrates your Jira issues to GitLab in a way that suits your needs exactly. GitLab provides APIs to help automate your migration:
To get started, familiarize yourself with the following GitLab API endpoints:
When writing your script, you need to map the Jira issue fields to their corresponding GitLab equivalents.
| Jira issue field | Possible GitLab equivalent |
|---|---|
| Custom fields with a fixed number of options | Create a scoped label set with the field name as the scoped label key and the field values as the scoped label set values. For example, input name::value1, input name::value2. |
| Custom fields with text strings or integer values | Inject the custom field name and value into a section in the issue's description. |
| Status | Use statuses. |
| Priority | Create a scoped label with the priority set as the scoped label key and the priority values as the scoped label set values. For example, priority::1. |
| Story Point | Map this value to the GitLab issue's weight value. |
| Sprint | Map this value to the GitLab issue's iteration value. This value is meaningful only for issues that have not been completed or are scheduled for a future sprint. Before importing the data, create the required iterations in the parent group of your project. |
You might also need to handle parsing the Atlassian Document Format and mapping it to GitLab Flavored Markdown. You can approach this in many different ways. For inspiration, review an example commit. This commit added a method to parse the Atlassian Document Format to GitLab Flavored Markdown for the Jira importer.
If you run GitLab locally, you can also convert Atlassian Document Format to GitLab Flavored Markdown manually in the Rails console. To do so, execute:
text = <document in Atlassian Document Format>
project = <project that wiki is in> or nil
Banzai.render(text, pipeline: :adf_commonmark, project: project)