{"record":{"id":"eb02e04f2f474227","repo":"multica-ai/multica","slug":"set-property-w","errorCode":null,"errorMessage":"set property: %w","messagePattern":"set property: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_property.go","lineNumber":647,"sourceCode":"\tproperties, err := fetchProperties(ctx, client)\n\tif err != nil {\n\t\treturn err\n\t}\n\tproperty, err := resolvePropertyRef(properties, name)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvalue, err := encodeIssuePropertyValue(property, rawValue)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar result struct {\n\t\tProperties map[string]any `json:\"properties\"`\n\t}\n\tpath := \"/api/issues/\" + issueRef.ID + \"/properties/\" + property.ID\n\tif err := client.PutJSON(ctx, path, map[string]any{\"value\": value}, &result); err != nil {\n\t\treturn fmt.Errorf(\"set property: %w\", err)\n\t}\n\trows := buildIssuePropertyRows(properties, result.Properties)\n\toutput, _ := cmd.Flags().GetString(\"output\")\n\tif output == \"json\" {\n\t\treturn cli.PrintJSON(os.Stdout, rows)\n\t}\n\tprintIssuePropertyRows(rows)\n\treturn nil\n}\n\nfunc runIssuePropertyUnset(cmd *cobra.Command, args []string) error {\n\tname, _ := cmd.Flags().GetString(\"name\")\n\tif name == \"\" {\n\t\treturn fmt.Errorf(\"--name is required\")\n\t}\n\n\tclient, err := newAPIClient(cmd)\n\tif err != nil {","sourceCodeStart":629,"sourceCodeEnd":665,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_property.go#L629-L665","documentation":"Returned by `runIssuePropertySet` when the PUT to `/api/issues/<issueID>/properties/<propertyID>` with `{\"value\": ...}` fails. Local encoding already succeeded (option IDs resolved, number/bool validated), so the failure is server-side: permissions, further validation, or transport.","triggerScenarios":"Server rejects the encoded value (e.g. archived property or option, type constraint beyond CLI checks, value locked by workflow state), 401/403, or network failure during the PUT.","commonSituations":"Setting a value on an archived property; options renamed server-side after the CLI fetched the property list; token expiry mid-script.","solutions":["Read the wrapped error: 400/422 → re-fetch the property (`multica property list`) to confirm it and its options are current, then retry.","401/403 → re-authenticate the CLI.","Network failure → verify server reachability and retry."],"exampleFix":"// before\nmultica issue property set ISS-1 --name Priority --value P0\n// error: set property: request failed: 422 ...\n\n// after\nmultica property list   # confirm property + options are active and current\nmultica issue property set ISS-1 --name Priority --value P0","handlingStrategy":"try-catch","validationCode":"# bash: pre-check property + option freshness so the server is unlikely to reject\nmultica property list --output json | jq -e --arg p \"$PROP\" --arg o \"$VAL\" '.[] | select(.name==$p) | .options[]?.name == $o' >/dev/null || { echo 'stale property/option' >&2; exit 1; }","typeGuard":null,"tryCatchPattern":"if err := client.PutJSON(ctx, path, map[string]any{\"value\": value}, &result); err != nil {\n    if isValidationError(err) { // refresh property list, re-encode, retry once }\n    return fmt.Errorf(\"set property: %w\", err)\n}","preventionTips":["Fetch the property list and set the value in the same run to avoid stale option IDs.","Do not set values on archived properties — unarchive first."],"tags":["go","cli","api","issue","property","network"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}