# Bug JIM-117 - Jira Migration stops if multiple Jira accounts have the same email/login

Project: Stream Jira to OpenProject data Migrator
Status: closed
URL: https://community.openproject.org/work_packages/JIM-117

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module | Integrations / Jira |
| Target versions | 17.6.0 |
| Observed in versions | 17.5.0 |
| Sprint |  |
| Backlog bucket |  |
| Bug found in version (deprecated) | 17.5.x |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers | Andrej Sandorf |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

### Steps to reproduce

1.  Have two accounts with the same email address in Jira

2.  Login to OP as a user with permissions to migrate from Jira

3.  Start a migration run of a project/issue where both accounts are used

### What is the buggy behavior?

  - The run is stopped with an error message
    
    <br>

    `Import::JiraOpenProjectReference with jira_entity_class Import::JiraUser and jira_entity_id 1486 not found!`

### What is the expected behavior?

1.  The import run continues without errors

2.  To satisfy OpenProject requirement of unique emails, the duplicated email is amended via the sub addressing mechanism <https://en.wikipedia.org/wiki/Email_address#Sub-addressing> with the accounts’ Jira key  
    e.g. `someone@example.com` ⇒ [`someone+JIRA0001@example.com`](mailto:someone+JIRA0001@example.com)  
       `someone+abc@example.com` ⇒ [`someone+abc+JIRA0001@example.com`](mailto:someone+JIRA0001@example.com)
    
    if [`someone+abc+JIRA0001@example.com`](mailto:someone+JIRA0001@example.com) already exists then a counter is added until a unique one can be found [`someone+abc+JIRA0001+1312@example.com`](mailto:someone+JIRA0001@example.com)

3.  If a login is already in use (but by someone with a different email address), the same method will be applied for that too  
    `someone` ⇒ [`someone+JIRA0001`](mailto:someone+JIRA0001@example.com)
    
    if  [`someone+JIRA0001`](mailto:someone+JIRA0001@example.com) already exists, a counter is added until a unique combination can be found  [`someone+JIRA0001+2304`](mailto:someone+JIRA0001@example.com)

### Screenshots and other files

<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/922403/content">

### Environment information

**OpenProject installation type**

  - All

**OpenProject version**

  - All since Jira migration beta release

**Browser**

  - All

**Operating System**

  - All

**Language**

  - All
