{"record":{"id":"8ef064676c666de0","repo":"theonedev/onedev","slug":"cannot-find-jira-issue-type-by-id-project-s-is","errorCode":null,"errorMessage":"Cannot find JIRA issue type by id (project: %s, issue type id: %s)","messagePattern":"Cannot find JIRA issue type by id \\(project: (.+?), issue type id: (.+?)\\)","errorType":"exception","errorClass":"ExplicitException","httpStatus":null,"severity":"error","filePath":"server-plugin/server-plugin-import-jiracloud/src/main/java/io/onedev/server/plugin/imports/jiracloud/ImportServer.java","lineNumber":573,"sourceCode":"\t\t\t\t\t\tString untranslatedTypeName = untranslatedTypeNames.get(typeId);\n\t\t\t\t\t\tif (untranslatedTypeName != null) {\n\t\t\t\t\t\t\tPair<FieldSpec, String> mapped = typeMappings.get(untranslatedTypeName);\n\t\t\t\t\t\t\tif (mapped != null) {\n\t\t\t\t\t\t\t\tIssueField typeField = new IssueField();\n\t\t\t\t\t\t\t\ttypeField.setIssue(issue);\n\t\t\t\t\t\t\t\ttypeField.setName(mapped.getLeft().getName());\n\t\t\t\t\t\t\t\ttypeField.setType(InputSpec.ENUMERATION);\n\t\t\t\t\t\t\t\ttypeField.setValue(mapped.getRight());\n\t\t\t\t\t\t\t\ttypeField.setOrdinal(mapped.getLeft().getOrdinal(mapped.getRight()));\n\t\t\t\t\t\t\t\tissue.getFields().add(typeField);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\textraIssueInfo.put(\"Type\", HtmlEscape.escapeHtml5(untranslatedTypeName));\n\t\t\t\t\t\t\t\tunmappedIssueTypes.add(untranslatedTypeName);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tString errorMessage = String.format(\"Cannot find JIRA issue type by id (project: %s, issue type id: %s)\", \n\t\t\t\t\t\t\t\t\tjiraProject.get(\"name\").asText(), typeId);\n\t\t\t\t\t\t\tthrow new ExplicitException(errorMessage);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tString priorityName = fieldsNode.get(\"priority\").get(\"name\").asText();\n\t\t\t\t\t\tPair<FieldSpec, String> mapped = priorityMappings.get(priorityName);\n\t\t\t\t\t\tif (mapped != null) {\n\t\t\t\t\t\t\tIssueField priorityField = new IssueField();\n\t\t\t\t\t\t\tpriorityField.setIssue(issue);\n\t\t\t\t\t\t\tpriorityField.setName(mapped.getLeft().getName());\n\t\t\t\t\t\t\tpriorityField.setType(InputSpec.ENUMERATION);\n\t\t\t\t\t\t\tpriorityField.setValue(mapped.getRight());\n\t\t\t\t\t\t\tpriorityField.setOrdinal(mapped.getLeft().getOrdinal(mapped.getRight()));\n\t\t\t\t\t\t\tissue.getFields().add(priorityField);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\textraIssueInfo.put(\"Priority\", HtmlEscape.escapeHtml5(priorityName));\n\t\t\t\t\t\t\tunmappedIssuePriorities.add(priorityName);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tList<String> components = new ArrayList<>();","sourceCodeStart":555,"sourceCodeEnd":591,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-plugin/server-plugin-import-jiracloud/src/main/java/io/onedev/server/plugin/imports/jiracloud/ImportServer.java#L555-L591","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before: issue type id 10500 (sub-task) not in project type list\n// after: exclude sub-tasks or re-type in Jira\n// Jira: bulk change issues of type 'Sub-task' -> 'Task', then re-run import","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"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 */ } }","preventionTips":["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."],"tags":["import","jira-cloud","issue-type"],"backgroundTag":"resource-not-found","analyzedSha":"d44925c47c37992c828ea673a5f9620539bc3ff2","analyzedAt":"2026-09-06T07:18:27.995Z","contentChangedAt":"2026-09-06T07:18:27.995Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}