{"record":{"id":"336ccb5cb998ccf6","repo":"github/github-mcp-server","slug":"issue-field-q-must-specify-either-value-or-field","errorCode":null,"errorMessage":"issue field %q must specify either value or field_option_name","messagePattern":"issue field %q must specify either value or field_option_name","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/github/issues.go","lineNumber":290,"sourceCode":"\t\t}\n\n\t\tif deleteField {\n\t\t\tif hasValue || fieldOptionName != \"\" {\n\t\t\t\treturn nil, fmt.Errorf(\"issue field %q cannot specify 'delete' together with 'value' or 'field_option_name'\", fieldName)\n\t\t\t}\n\t\t\tissueFields = append(issueFields, issueWriteFieldInput{\n\t\t\t\tFieldName: fieldName,\n\t\t\t\tDelete:    true,\n\t\t\t})\n\t\t\tcontinue\n\t\t}\n\n\t\tif hasValue && fieldOptionName != \"\" {\n\t\t\treturn nil, fmt.Errorf(\"issue field %q cannot specify both value and field_option_name\", fieldName)\n\t\t}\n\n\t\tif !hasValue && fieldOptionName == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"issue field %q must specify either value or field_option_name\", fieldName)\n\t\t}\n\n\t\tissueFields = append(issueFields, issueWriteFieldInput{\n\t\t\tFieldName:       fieldName,\n\t\t\tValue:           value,\n\t\t\tFieldOptionName: fieldOptionName,\n\t\t})\n\t}\n\n\treturn issueFields, nil\n}\n\nfunc resolveIssueRequestFieldValues(ctx context.Context, gqlClient *githubv4.Client, owner, repo string, issueFields []issueWriteFieldInput) ([]*github.IssueRequestFieldValue, []int64, error) {\n\tif len(issueFields) == 0 {\n\t\treturn nil, nil, nil\n\t}\n\n\tctxWithFeatures := ghcontext.WithGraphQLFeatures(ctx, \"issue_fields\", \"repo_issue_fields\")","sourceCodeStart":272,"sourceCodeEnd":308,"githubUrl":"https://github.com/github/github-mcp-server/blob/0ea1f775a7c73eff1bd2e25904d01136756bbfe2/pkg/github/issues.go#L272-L308","documentation":"optionalIssueWriteFields (pkg/github/issues.go:290) is the final shape check on a non-delete issue_fields item: it must carry either value or field_option_name. The error fires when an item has field_name but no payload at all — an update that would be a no-op is rejected before any network call.","triggerScenarios":"update_issue with {\"field_name\":\"Priority\"} alone; or {\"field_name\":\"Priority\",\"value\":\"\"} is NOT this case (empty string counts as a value) — the pure absence of both keys triggers it.","commonSituations":"Agents enumerating field names without payloads; partially-built args from templating; callers expecting field_name alone to read a field (use get_issue / get_labels style reads instead).","solutions":["Add the payload: value for text/number/date fields, field_option_name for single-select","If the goal is to clear the field use delete:true","If the goal is to read field values, use the read tooling instead of update_issue"],"exampleFix":"# before\n{\"issue_fields\": [{\"field_name\": \"Priority\"}]}\n\n# after\n{\"issue_fields\": [{\"field_name\": \"Priority\", \"field_option_name\": \"P1\"}]}","handlingStrategy":"validation","validationCode":"for _, item := range inputMaps {\n    _, hasValue := item[\"value\"]\n    opt, _ := item[\"field_option_name\"].(string)\n    if !hasValue && strings.TrimSpace(opt) == \"\" {\n        return errors.New(\"each non-delete issue_fields item needs value or field_option_name\")\n    }\n}","typeGuard":"func hasPayload(item map[string]any) bool {\n    if del, _ := item[\"delete\"].(bool); del {\n        return true\n    }\n    _, hasValue := item[\"value\"]\n    opt, _ := item[\"field_option_name\"].(string)\n    return hasValue || strings.TrimSpace(opt) != \"\"\n}","tryCatchPattern":null,"preventionTips":["Read field values with the read tools; update_issue items must always change something","Reject no-op field items in your builder — cheaper than a failed API round trip","For single-select fields remember empty-string field_option_name counts as absent"],"tags":["go","validation","issue-fields","mcp"],"backgroundTag":null,"analyzedSha":"0ea1f775a7c73eff1bd2e25904d01136756bbfe2","analyzedAt":"2026-08-15T18:10:19.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}