{"record":{"id":"ccd157d86d9a80e8","repo":"theonedev/onedev","slug":"error-validating-issue-fields","errorCode":null,"errorMessage":"Error validating issue fields: ","messagePattern":"Error validating issue fields: ","errorType":"validation","errorClass":"ValidationException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/buildspec/job/action/CreateIssueAction.java","lineNumber":130,"sourceCode":"\t\t\tOneDev.getInstance(IssueService.class).open(issue);\n\t\t});\n\t\t\n\t}\n\n\t@Override\n\tpublic String getDescription() {\n\t\treturn \"Create issue\";\n\t}\n\n\t@Override\n\tpublic void validateWith(BuildSpec buildSpec, Job job) {\n\t\tsuper.validateWith(buildSpec, job);\n\t\t\n\t\tGlobalIssueSetting issueSetting = OneDev.getInstance(SettingService.class).getIssueSetting();\n\t\ttry {\n\t\t\tFieldUtils.validateFields(issueSetting.getFieldSpecMap(getFieldNames()), issueFields);\n\t\t} catch (ValidationException e) {\n\t\t\tthrow new ValidationException(\"Error validating issue fields: \" + e.getMessage());\n\t\t}\n\t\t\n\t}\n\n}\n","sourceCodeStart":112,"sourceCodeEnd":136,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/buildspec/job/action/CreateIssueAction.java#L112-L136","documentation":"CreateIssueAction.validateWith validates the action's issueFields against the fields defined in the global issue setting (FieldUtils.validateFields). On ValidationException it rethrows with the prefix 'Error validating issue fields:' plus the underlying message, so the build spec author knows their issue field values/inputs do not match the issue field specifications.","triggerScenarios":"validateWith(buildSpec, job) is invoked during build spec validation and FieldUtils.validateFields rejects issueFields — e.g. a required issue field is missing, a value violates the field type/choice list, or an unknown field name is supplied.","commonSituations":"Issue settings changed (field removed/renamed or choice value deleted) after the action was written; typo in a field name; supplying a string where a date/user/enum field is expected; field made mandatory later.","solutions":["Fix the field named in the appended validation message to match the field spec (correct name, type, and allowed values).","Check Administration > Issue Settings > Custom Fields for the current field names and choice values.","Update the action after any change to issue custom fields so it references still-existing fields."],"exampleFix":"// before: unknown field / bad choice\nissueFields:\n  Priority: Highest\n// after (matches setting choices)\nissueFields:\n  Priority: Critical","handlingStrategy":"validation","validationCode":"// Compare action fields against current issue settings\nvar specMap = OneDev.getInstance(SettingService.class).getIssueSetting().getFieldSpecMap();\nissueFields.keySet().forEach(name -> {\n    if (!specMap.containsKey(name)) throw new IllegalArgumentException(\"Unknown issue field: \" + name);\n});","typeGuard":null,"tryCatchPattern":"try { action.validateWith(buildSpec, job); } catch (ValidationException e) { fixIssueFields(e.getMessage()); }","preventionTips":["Review CreateIssueAction configs whenever issue custom fields are renamed or removed.","Use exact choice values as configured in issue settings.","Validate the build spec in the editor before pushing."],"tags":["validation","issue-fields","buildspec","onedev"],"backgroundTag":"schema-validation-failed","analyzedSha":"d44925c47c37992c828ea673a5f9620539bc3ff2","analyzedAt":"2026-09-06T07:18:27.995Z","contentChangedAt":"2026-09-06T07:18:27.995Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}