theonedev/onedev · error · ExplicitException
Cannot find JIRA issue type by id (project: %s, issue type i
Error message
Cannot find JIRA issue type by id (project: %s, issue type id: %s)
What it means
Also in consume(): when an issue's issuetype id cannot be translated through untranslatedTypeNames (the id is not among the project's issue types), the import throws this formatted ExplicitException naming the Jira project and the unknown type id. Type mappings are keyed by type name, so an unknown id makes mapping impossible.
Source
Thrown at server-plugin/server-plugin-import-jiracloud/src/main/java/io/onedev/server/plugin/imports/jiracloud/ImportServer.java:573
String untranslatedTypeName = untranslatedTypeNames.get(typeId);
if (untranslatedTypeName != null) {
Pair<FieldSpec, String> mapped = typeMappings.get(untranslatedTypeName);
if (mapped != null) {
IssueField typeField = new IssueField();
typeField.setIssue(issue);
typeField.setName(mapped.getLeft().getName());
typeField.setType(InputSpec.ENUMERATION);
typeField.setValue(mapped.getRight());
typeField.setOrdinal(mapped.getLeft().getOrdinal(mapped.getRight()));
issue.getFields().add(typeField);
} else {
extraIssueInfo.put("Type", HtmlEscape.escapeHtml5(untranslatedTypeName));
unmappedIssueTypes.add(untranslatedTypeName);
}
} else {
String errorMessage = String.format("Cannot find JIRA issue type by id (project: %s, issue type id: %s)",
jiraProject.get("name").asText(), typeId);
throw new ExplicitException(errorMessage);
}
String priorityName = fieldsNode.get("priority").get("name").asText();
Pair<FieldSpec, String> mapped = priorityMappings.get(priorityName);
if (mapped != null) {
IssueField priorityField = new IssueField();
priorityField.setIssue(issue);
priorityField.setName(mapped.getLeft().getName());
priorityField.setType(InputSpec.ENUMERATION);
priorityField.setValue(mapped.getRight());
priorityField.setOrdinal(mapped.getLeft().getOrdinal(mapped.getRight()));
issue.getFields().add(priorityField);
} else {
extraIssueInfo.put("Priority", HtmlEscape.escapeHtml5(priorityName));
unmappedIssuePriorities.add(priorityName);
}
List<String> components = new ArrayList<>();View on GitHub (pinned to d44925c47c)
Solutions
- Ensure every imported issue's type exists in the target Jira project's issue type scheme, then re-import.
- Add an issue type mapping in the import option for the Jira type so its id resolves via the refreshed type list.
- Change the issue's type in Jira to one available in the project (e.g. convert sub-tasks to standard issues) before importing.
- Restart the import to refresh the project type list if types were recently modified.
Example fix
// before: issue type id 10500 (sub-task) not in project type list // after: exclude sub-tasks or re-type in Jira // Jira: bulk change issues of type 'Sub-task' -> 'Task', then re-run import
Defensive patterns
Strategy: try-catch
Try / catch
try { importServer.doImport(...) } catch (ExplicitException e) { if (e.getMessage().startsWith("Cannot find JIRA issue type by id")) { /* add type to project scheme or re-type issue */ } } Prevention
- Include all used issue types in the project's issue type scheme.
- Re-type moved/sub-task issues before import.
- Refresh the type list after Jira scheme changes.
When it happens
Trigger: consume() reads the issuetype id from the issue fields node and untranslatedTypeNames.get(typeId) is null — the Jira issue references an issue type id absent from the fetched project type list.
Common situations: Issue has a type from a different project (moved issues); type deleted in Jira after the option was saved; sub-task types not returned in the fetched project type list; importing issues across projects with mismatched type sets.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- Import target already exists. You need to have project manag
- Unable to find project:
- No field spec found:
- Cannot find JIRA status of id:
- Duplicate issue field mapping (issue: %s, field: %s)
AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06).
Data as JSON: /api/errors/8ef064676c666de0.
Report an issue: GitHub.