{"record":{"id":"9b5324a3732bae2a","repo":"multica-ai/multica","slug":"value-must-list-at-least-one-option-valid-optio","errorCode":null,"errorMessage":"--value must list at least one option; valid options: %s","messagePattern":"--value must list at least one option; valid options: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_property.go","lineNumber":474,"sourceCode":"\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 {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tids = append(ids, id)\n\t\t}\n\t\tif len(ids) == 0 {\n\t\t\treturn nil, fmt.Errorf(\"--value must list at least one option; valid options: %s\", strings.Join(optionNames, \", \"))\n\t\t}\n\t\treturn json.Marshal(ids)\n\tcase \"number\":\n\t\tif _, err := strconv.ParseFloat(raw, 64); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"value %q is not a valid number\", raw)\n\t\t}\n\t\treturn json.RawMessage(raw), nil\n\tcase \"checkbox\":\n\t\tif raw != \"true\" && raw != \"false\" {\n\t\t\treturn nil, fmt.Errorf(\"value %q is not a valid bool (expected true or false)\", raw)\n\t\t}\n\t\treturn json.RawMessage(raw), nil\n\tdefault: // text, date, url — validated server-side\n\t\treturn json.Marshal(raw)\n\t}\n}\n\n// formatIssuePropertyValue renders a stored value for humans: option ids","sourceCodeStart":456,"sourceCodeEnd":492,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_property.go#L456-L492","documentation":"Returned by `encodeIssuePropertyValue` for multi_select properties when `--value` contained only empty segments after splitting on commas (e.g. `--value \"\"` or `--value \",,\"`), so zero option IDs were collected. The message lists the valid option names.","triggerScenarios":"`--value \"\"`, `--value \" , \"` or `--value \",,\"` on a multi_select property — every comma-separated part trims to empty and is skipped, leaving `ids` empty.","commonSituations":"Scripts passing an unset shell variable (`--value \"$VAL\"` with VAL empty) intending to clear a multi_select; copy-paste of a comma placeholder.","solutions":["Pass at least one valid option name/ID: `--value \"P0\"` or `--value \"P0,P1\"`.","If the intent was to clear the value, use `multica issue property unset` instead of setting an empty list.","In scripts, guard: skip the call (or unset) when the composed value string is empty/whitespace."],"exampleFix":"// before\nVAL=\"\"\nmultica issue property set ISS-1 --name Tags --value \"$VAL\"\n// error: --value must list at least one option; valid options: ...\n\n// after\nVAL=\"\"\nif [ -z \"$VAL\" ]; then multica issue property unset ISS-1 --name Tags; else multica issue property set ISS-1 --name Tags --value \"$VAL\"; fi","handlingStrategy":"validation","validationCode":"# bash: never pass an all-empty multi_select value\n[ -n \"$(printf '%s' \"$VAL\" | tr -d '[:space:],')\" ] || { echo 'empty multi_select value' >&2; exit 1; }","typeGuard":"func hasNonEmptySegments(raw string) bool {\n    for _, part := range strings.Split(raw, \",\") {\n        if strings.TrimSpace(part) != \"\" {\n            return true\n        }\n    }\n    return false\n}","tryCatchPattern":null,"preventionTips":["Use `issue property unset` to clear a multi_select, never an empty string.","Check that comma-separated values contain at least one non-blank segment."],"tags":["go","cli","validation","multi-select"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}