# Feature JIM-76 - Jira Migrator imports issue links as relationships

Project: Stream Jira to OpenProject data Migrator
Status: review failed
URL: https://community.openproject.org/work_packages/JIM-76

## Planning

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Target versions | 18.0.0 |
| Sprint |  |
| Backlog bucket |  |
| Votes |  |
| List |  |
| Roadmap |  |
| Relevance |  |

## OPEN POINTS / FEEDBACK

_No work packages_

## Features and Chunks

_No work packages_

## Bugs and other work packages

_No work packages_

## Technical Details

| Attribute | Value |
| --- | --- |
| Module | Integrations / Jira |
| Feature Flag |  |
| Requires doc change | No |
| Enterprise plan | Community (COM) |

## Details

| Attribute | Value |
| --- | --- |
| Pull preview |  |
| Mockups |  |
| Accessibility | No |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers |  |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by | Express (8754) |

## Estimates and progress

| Attribute | Value |
| --- | --- |
| PD (min) |  |
| PD (max) |  |
| Work |  |
| Labor costs |  |

## Description

As an admin migrating projects from Jira to OpenProject,  
I want issue links (relationships between issues) to be automatically migrated as OpenProject relations,  
so that the relationship structure between work items is preserved after migration.

## Acceptance Criteria

*   Blocks/is blocked by links are migrated as `blocks`/`blocked` relations.
    
*   Duplicates/is duplicated by links are migrated as `duplicates`/`duplicated` relations.
    
*   Clones and Relates links are migrated as `relates` relations with descriptive text.
    
*   Custom Jira link types are migrated as `relates` relations with description preserving the original type name and direction.
    
*   Links to issues not in the import scope are handled gracefully (warning logged, no error).
    
*   Links to previously imported issues (from earlier import runs) are resolved using origin columns.
    
*   Running the import twice does not create duplicate relations.
    

## Technical Notes

*   Jira link type mapping uses the `type.name` field (e.g., &quot;Blocks&quot;, &quot;Duplicate&quot;).
    
*   Each issue link in Jira contains either `outwardIssue` or `inwardIssue`, indicating the direction.
    
*   The description for unmapped types follows the format: `"{TypeName}: {direction_label}"` (e.g., &quot;Tests: tested by&quot;).
    
*   Link Resolution
    
    *   Relations are created by looking up work packages using the persistent origin mapping:
        
    *   **Within current import:** Look up the linked issue in the import&#x27;s `JiraIssue` records, then find the corresponding OpenProject work package.
        
    *   **From previous imports:** If not found in current import, look up by `origin_source`, `origin_host`, and `origin_id` columns on `work_packages` table.
        
*   Edge Cases
    
    *   **Link to non-imported issue:** Logged as warning, relation skipped.
        
    *   **Link to issue from different Jira instance:** Skipped (different `origin_host`).
        
    *   **Duplicate relations:** Checked before creation, duplicates are skipped.
        
    *   **Self-referential links:** Skipped with warning.
        
*   Relations are created in **Stage 10** of the import pipeline.
