{"record":{"id":"efb39b603c0748bb","repo":"theonedev/onedev","slug":"param-not-found","errorCode":null,"errorMessage":"Param not found: ","messagePattern":"Param not found: ","errorType":"exception","errorClass":"ExplicitException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/buildspec/job/action/condition/ActionCondition.java","lineNumber":218,"sourceCode":"\t\t\tif (operator != Is && operator != IsNot)\n\t\t\t\tthrow newOperatorException(fieldName, operator);\n\t\t} else if (fieldName.equals(NAME_BRANCH) || fieldName.equals(NAME_TAG)) {\n\t\t\tif (operator != Is && operator != IsNot && operator != IsEmpty && operator != IsNotEmpty)\n\t\t\t\tthrow newOperatorException(fieldName, operator);\n\t\t} else if (fieldName.equals(NAME_PULL_REQUEST)) {\n\t\t\tif (operator != IsEmpty && operator != IsNotEmpty)\n\t\t\t\tthrow newOperatorException(fieldName, operator);\n\t\t} else if (fieldName.equals(NAME_AI_PULL_REQUEST)) {\n\t\t\tif (operator != IsEmpty && operator != IsNotEmpty)\n\t\t\t\tthrow newOperatorException(fieldName, operator);\n\t\t} else if (fieldName.equals(NAME_LOG)) {\n\t\t\tif (operator != Contains)\n\t\t\t\tthrow newOperatorException(fieldName, operator);\n\t\t} else if (job.getParamSpecMap().containsKey(fieldName)) {\n\t\t\tif (operator != Is && operator != IsNot && operator != IsEmpty && operator != IsNotEmpty)\n\t\t\t\tthrow newOperatorException(fieldName, operator);\n\t\t} else {\n\t\t\tthrow new ExplicitException(\"Param not found: \" + fieldName);\n\t\t}\n\t}\n\t\n\tprivate static ExplicitException newOperatorException(String fieldName, int operator) {\n\t\treturn new ExplicitException(\"Field '\" + fieldName + \"' is not applicable for operator '\" \n\t\t\t\t+ AntlrUtils.getLexerRuleName(ActionConditionLexer.ruleNames, operator) + \"'\");\n\t}\n\n\tpublic static String getRuleName(int rule) {\n\t\treturn AntlrUtils.getLexerRuleName(ActionConditionLexer.ruleNames, rule);\n\t}\n\t\n\t@Override\n\tpublic String toStringWithoutParens() {\n\t\treturn criteria.toStringWithoutParens();\n\t}\n\n\t@Override","sourceCodeStart":200,"sourceCodeEnd":236,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/buildspec/job/action/condition/ActionCondition.java#L200-L236","documentation":"Thrown by ActionCondition.checkField when a field name in a field-operator criteria matches neither a built-in build field nor a job parameter spec. The condition references a parameter that the job does not define.","triggerScenarios":"A condition like 'paramName is value' where paramName is not defined in the job's input/param specs (job.getParamSpecMap() has no such key) and is not a known build field.","commonSituations":"Renaming a job input without updating conditions that reference it; typo in the param name; referencing params from a different job's spec.","solutions":["Add the parameter to the job's input spec so it exists in job.getParamSpecMap().","Correct the field name spelling in the condition to match a defined param or built-in field.","Use only allowed operators if the field exists but the combination is rejected (the sibling 'not applicable for operator' error)."],"exampleFix":"// before (job has no input named 'env')\ncondition: env is production\n\n// after: define the input in the job spec\ninputs:\n- name: env\n  type: choice\n  items: [production, staging]\n// then the condition works\ncondition: env is production","handlingStrategy":"validation","validationCode":"Set<String> allowed = new HashSet<>(List.of(\"project\",\"number\",\"version\",\"branch\",\"tag\"));\njob.getParamSpecMap().keySet().forEach(allowed::add);\nif (!allowed.contains(fieldName))\n    throw new IllegalArgumentException(\"Condition field '\" + fieldName + \"' is not a job param\");","typeGuard":null,"tryCatchPattern":"try {\n    ActionCondition.parse(text, job, build);\n} catch (ExplicitException e) {\n    if (e.getMessage().startsWith(\"Param not found:\")) {\n        // correct field name or add the param spec\n    } else throw e;\n}","preventionTips":["Keep param specs and conditions in sync; grep conditions on param renames.","Reference params by exact declared name.","Review job spec diff for renamed inputs before merging."],"tags":["onedev","condition-syntax","job-params","buildspec"],"backgroundTag":"invalid-query-parameter","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"}