# Bug JIM-64 - Request for an user by key fails and stops the import

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

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | High |
| Module |  |
| Target versions | 17.3.0 |
| Observed in versions |  |
| Sprint |  |
| Backlog bucket |  |
| Bug found in version (deprecated) |  |
| 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.  Login as a user with permissions to import Jira data

2.  Start an import run for our DC instance

3.  Choose project "DSIV - Reporting Ventes Groupe"

4.  Import

### What is the buggy behavior?

  - The import stops with an error status 404

### What is the expected behavior?

1.  The import succeeds

### Technical reasoning

Somewhere in this data there is a reference to user "JIRAUSER99700"   
this user is not available via the call in the [Jira importer](https://github.com/opf/openproject/blob/9875e98cb7a0cd3f1d3dc7b8bcc39b941b994ff6/app/workers/import/jira_fetch_and_import_projects_job.rb#L136).

The data Jira is sending is not clean. E.g. in this case it contains a user key which is not available in the Jira instance: Jira API returning 404. This stops the import. If we can't retrieve a user for a Jira user key, we just log the error but continue as we have no other option.

<figure class="image image_resized op-uc-figure" style="width:621px;"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/919941/content"></div><figcaption class="op-uc-figure--description">The user is not available in Jira itself</figcaption></figure>

We also only use the key if the user was referenced in the Jira history. For potential other user positions, e.g. assignee - nobody is assigned.  
<img class="image_resized op-uc-image op-uc-image_inline" style="width:340px;" src="/api/v3/attachments/919958/content">

### Screenshots and other files

<img class="image_resized op-uc-image op-uc-image_inline" style="width:612px;" src="/api/v3/attachments/919895/content">

### Environment information

**OpenProject installation type**

- [x] All

**OpenProject version**

17.2

**Browser**

- [x] All

**Operating System**

- [x] All

**Language**

- [x] All
