{"record":{"id":"499a74416bcea8be","repo":"multica-ai/multica","slug":"option-q-not-found-on-property-q-valid-options","errorCode":null,"errorMessage":"option %q not found on property %q; valid options: %s","messagePattern":"option %q not found on property %q; valid options: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_property.go","lineNumber":450,"sourceCode":"// ---------------------------------------------------------------------------\n// issue property {list|set|unset}\n// ---------------------------------------------------------------------------\n\n// encodeIssuePropertyValue converts the CLI --value string into the typed\n// JSON the API expects, translating option names to ids for select types.\nfunc encodeIssuePropertyValue(property propertyDTO, raw string) (json.RawMessage, error) {\n\toptionNames := make([]string, len(property.Config.Options))\n\tfor i, opt := range property.Config.Options {\n\t\toptionNames[i] = opt.Name\n\t}\n\tresolveOption := func(ref string) (string, error) {\n\t\tref = strings.TrimSpace(ref)\n\t\tfor _, opt := range property.Config.Options {\n\t\t\tif opt.ID == ref || strings.EqualFold(opt.Name, ref) {\n\t\t\t\treturn opt.ID, nil\n\t\t\t}\n\t\t}\n\t\treturn \"\", fmt.Errorf(\"option %q not found on property %q; valid options: %s\", ref, property.Name, strings.Join(optionNames, \", \"))\n\t}\n\n\tswitch property.Type {\n\tcase \"select\":\n\t\tid, err := resolveOption(raw)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn json.Marshal(id)\n\tcase \"multi_select\":\n\t\tparts := strings.Split(raw, \",\")\n\t\tids := make([]string, 0, len(parts))\n\t\tfor _, part := range parts {\n\t\t\tif strings.TrimSpace(part) == \"\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tid, err := resolveOption(part)\n\t\t\tif err != nil {","sourceCodeStart":432,"sourceCodeEnd":468,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_property.go#L432-L468","documentation":"Thrown by `encodeIssuePropertyValue`'s `resolveOption` closure when the value passed to `--value` for a select/multi_select property does not match any option by ID or case-insensitive name. The message lists all valid option names for the target property to make correction immediate.","triggerScenarios":"`multica issue property set <issue> --name <select-prop> --value <bad>` where `<bad>` is neither an option ID nor an option name (case-insensitive). For multi_select, any comma-separated segment that fails resolution triggers it.","commonSituations":"Typo in an option name; option was renamed or archived after the script was written; using a display label that differs from the configured option name.","solutions":["Use one of the option names listed in the error message exactly (matching is case-insensitive, so casing is safe).","Run `multica property list` (or `multica issue property list <issue>`) to see current options and their names.","Update scripts that hard-code old option names after renaming options on a property."],"exampleFix":"// before\nmultica issue property set ISS-1 --name Priority --value urgent\n// error: option \"urgent\" not found on property \"Priority\"; valid options: P0, P1, P2\n\n// after\nmultica issue property set ISS-1 --name Priority --value P0","handlingStrategy":"validation","validationCode":"# bash: verify the option exists on the property before setting\nmultica property list | grep -qw \"$OPT\" || { echo \"option $OPT not on property $PROP\" >&2; exit 1; }","typeGuard":"func isValidOption(p propertyDTO, ref string) bool {\n    ref = strings.TrimSpace(ref)\n    for _, opt := range p.Config.Options {\n        if opt.ID == ref || strings.EqualFold(opt.Name, ref) {\n            return true\n        }\n    }\n    return false\n}","tryCatchPattern":null,"preventionTips":["Always copy option names from `multica property list` output.","Matching is by ID or case-insensitive name — prefer the exact name.","Re-validate hard-coded option names whenever property configs change."],"tags":["go","cli","validation","property","select"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}