theonedev/onedev · error · ExplicitException
No field spec found:
Error message
No field spec found:
What it means
Raised in importIssues (via doImport) while building type mappings: each IssueTypeMapping names a OneDev issue field as "name::value"; the code splits off the name, looks it up in the project's issue setting via getIssueSetting().getFieldSpec(name), and throws this ExplicitException when no such field spec is defined in the target project. The mapping cannot be applied without an existing field spec.
Source
Thrown at server-plugin/server-plugin-import-jiracloud/src/main/java/io/onedev/server/plugin/imports/jiracloud/ImportServer.java:441
Map<String, Optional<Long>> userIds, boolean dryRun, TaskLogger logger) {
IssueService issueService = OneDev.getInstance(IssueService.class);
Client client = newClient();
try {
Set<String> unmappedIssueStatuses = new HashSet<>();
Set<String> unmappedIssueTypes = new HashSet<>();
Set<String> unmappedIssuePriorities = new HashSet<>();
Set<String> nonExistentLogins = new HashSet<>();
Set<String> tooLargeAttachments = new LinkedHashSet<>();
Set<String> errorAttachments = new HashSet<>();
Map<String, Pair<FieldSpec, String>> typeMappings = new HashMap<>();
for (IssueTypeMapping mapping: option.getIssueTypeMappings()) {
String oneDevFieldName = StringUtils.substringBefore(mapping.getOneDevIssueField(), "::");
String oneDevFieldValue = StringUtils.substringAfter(mapping.getOneDevIssueField(), "::");
FieldSpec fieldSpec = getIssueSetting().getFieldSpec(oneDevFieldName);
if (fieldSpec == null)
throw new ExplicitException("No field spec found: " + oneDevFieldName);
typeMappings.put(mapping.getJiraIssueType(), new Pair<>(fieldSpec, oneDevFieldValue));
}
Map<String, Pair<FieldSpec, String>> priorityMappings = new HashMap<>();
for (IssuePriorityMapping mapping: option.getIssuePriorityMappings()) {
String oneDevFieldName = StringUtils.substringBefore(mapping.getOneDevIssueField(), "::");
String oneDevFieldValue = StringUtils.substringAfter(mapping.getOneDevIssueField(), "::");
FieldSpec fieldSpec = getIssueSetting().getFieldSpec(oneDevFieldName);
if (fieldSpec == null)
throw new ExplicitException("No field spec found: " + oneDevFieldName);
priorityMappings.put(mapping.getJiraIssuePriority(), new Pair<>(fieldSpec, oneDevFieldValue));
}
String initialIssueState = getIssueSetting().getInitialStateSpec().getName();
List<Issue> issues = new ArrayList<>();
View on GitHub (pinned to d44925c47c)
Solutions
- Add the missing custom field (Issue Settings -> Custom Fields) to the target project with exactly the mapped name, then re-run the import.
- Fix the mapping's OneDev issue field value to use an existing field spec's exact name, keeping the "Name::Value" format.
- If the field belongs to another project, either run the import against that project or replicate the field spec in the target.
- Refresh the import option UI so its field dropdown reloads the current field specs and pick from it rather than typing a name.
Example fix
// before
mapping.setOneDevIssueField("Story Points::3"); // no 'Story Points' spec in target
// after: create the spec first, or use existing field
mapping.setOneDevIssueField("Estimation::3"); // 'Estimation' spec exists Defensive patterns
Strategy: validation
Validate before calling
String fieldName = StringUtils.substringBefore(mapping.getOneDevIssueField(), "::");
if (issueSetting.getFieldSpec(fieldName) == null)
throw new IllegalArgumentException("Field spec missing in target project: " + fieldName); Try / catch
try { importServer.doImport(...) } catch (ExplicitException e) { if (e.getMessage().startsWith("No field spec found")) { /* create field or fix mapping */ } } Prevention
- Create all custom field specs in the target project before configuring mappings.
- Pick field names from the option UI dropdown instead of typing.
- Re-check mappings after any issue-setting changes.
When it happens
Trigger: importIssues -> option.getIssueTypeMappings() loop where mapping.getOneDevIssueField()'s part before '::' is not found by getIssueSetting().getFieldSpec() — the mapped OneDev field name does not exist (or is not a custom field spec) in the target project's Issue Settings custom fields.
Common situations: Mapping references a custom field deleted from the target project after the import option was created; field defined in a different project than the import target; field name typo or trailing whitespace; importing into a freshly created project that has no custom fields yet.
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
- Unable to find project:
- Import target already exists. You need to have project manag
- Cannot find JIRA status of id:
- Cannot find JIRA issue type by id (project: %s, issue type i
- Duplicate issue field mapping (issue: %s, field: %s)
AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06).
Data as JSON: /api/errors/5854eac8b436e5f4.
Report an issue: GitHub.