{"record":{"id":"3ddad02e16804f57","repo":"theonedev/onedev","slug":"unknown-issue-field-fieldname","errorCode":null,"errorMessage":"Unknown issue field: ${fieldName}","messagePattern":"Unknown issue field: (.+?)","errorType":"validation","errorClass":"ValidationException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/model/support/issue/field/FieldUtils.java","lineNumber":192,"sourceCode":"\t\t\tif (fieldSpec instanceof SecretField)\n\t\t\t\tdisplayValue = SecretInput.MASK;\n\t\t\telse\n\t\t\t\tdisplayValue = fieldValue.toString();\n\t\t\tif (e.getMessage() == null)\n\t\t\t\tlogger.error(\"Error validating field value\", e);\n\t\t\tthrow new ValidationException(\"Error validating value '\" + displayValue + \"' of field '\" \n\t\t\t\t\t+ fieldName + \"': \" + e.getMessage());\n\t\t}\n\t}\n\n\tprivate static void validateFieldNames(Collection<String> fieldSpecNames, Collection<String> fieldNames) {\n\t\tfor (String fieldSpecName: fieldSpecNames) {\n\t\t\tif (!fieldNames.contains(fieldSpecName))\n\t\t\t\tthrow new ValidationException(\"Missing issue field: \" + fieldSpecName);\n\t\t}\n\t\tfor (String fieldName: fieldNames) {\n\t\t\tif (!fieldSpecNames.contains(fieldName))\n\t\t\t\tthrow new ValidationException(\"Unknown issue field: \" + fieldName);\n\t\t}\n\t}\n\t\n\tpublic static void validateFieldMap(Map<String, FieldSpec> fieldSpecMap, Map<String, List<String>> fieldMap) {\n\t\tvalidateFieldNames(fieldSpecMap.keySet(), fieldMap.keySet());\n\t\tfor (Map.Entry<String, List<String>> entry: fieldMap.entrySet()) {\n\t\t\tif (entry.getValue() != null) {\n\t\t\t\tFieldSpec fieldSpec = Preconditions.checkNotNull(fieldSpecMap.get(entry.getKey()));\n\t\t\t\tvalidateFieldValue(fieldSpec, entry.getKey(), entry.getValue());\n\t\t\t}\n\t\t}\n\t}\n\t\n\tpublic static void validateFields(Map<String, FieldSpec> fieldSpecs, List<FieldInstance> fields) {\n\t\tMap<String, List<String>> fieldMap = new HashMap<>();\n\t\tfor (FieldInstance field: fields) {\n\t\t\tList<String> values;\n\t\t\tif (field.getValueProvider() instanceof SpecifiedValue)","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/model/support/issue/field/FieldUtils.java#L174-L210","documentation":"validateFieldNames also checks the reverse direction: any supplied field name that has no matching field spec causes ValidationException 'Unknown issue field: <name>'. This guards against typos and fields from other projects.","triggerScenarios":"Passing a field name in the field map that is not defined in the project's issue settings, e.g. misspelled names or fields copied from another project.","commonSituations":"Renamed custom fields with scripts still using old names; cross-project issue moves carrying fields that don't exist in the destination project.","solutions":["Remove or rename the offending key in the field map to match a defined field spec","Define the field in the project's issue settings if it should exist","List valid specs via issueSetting.getFieldSpecs() before building the map"],"exampleFix":"// before\nfieldMap.put(\"prority\", List.of(\"High\")); // typo\n// after\nfieldMap.put(\"Priority\", List.of(\"High\"));","handlingStrategy":"validation","validationCode":"Set<String> unknown = new HashSet<>(fieldMap.keySet());\nunknown.removeAll(fieldSpecMap.keySet());\nif (!unknown.isEmpty()) throw new IllegalStateException(\"Unknown fields: \" + unknown);","typeGuard":null,"tryCatchPattern":"try {\n    FieldUtils.validateFieldMap(fieldSpecMap, fieldMap);\n} catch (ValidationException e) {\n    if (e.getMessage().startsWith(\"Unknown issue field\"))\n        fieldMap.keySet().removeIf(n -> !fieldSpecMap.containsKey(n));\n}","preventionTips":["Build field maps from getFieldSpecs() output, not string literals","Update field name constants whenever specs are renamed","Filter fields by target project when moving issues"],"tags":["issue-fields","validation","naming"],"backgroundTag":"invalid-argument-value","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"}