{"record":{"id":"b733ef2fc9db18c6","repo":"github/github-mcp-server","slug":"issue-field-q-is-q-so-field-option-name-cannot","errorCode":null,"errorMessage":"issue field %q is %q, so field_option_name cannot be used","messagePattern":"issue field %q is %q, so field_option_name cannot be used","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/github/issues.go","lineNumber":374,"sourceCode":"\t\tcase \"IssueFieldSingleSelect\":\n\t\t\tfullDatabaseIDStr = string(node.IssueFieldSingleSelect.FullDatabaseID)\n\t\t\tdataType = string(node.IssueFieldSingleSelect.DataType)\n\t\t}\n\n\t\tfieldID := parseFullDatabaseID(fullDatabaseIDStr)\n\t\tif fieldID == 0 {\n\t\t\treturn nil, nil, fmt.Errorf(\"issue field %q is missing fullDatabaseId\", fieldInput.FieldName)\n\t\t}\n\n\t\tif fieldInput.Delete {\n\t\t\tfieldIDsToDelete = append(fieldIDsToDelete, fieldID)\n\t\t\tcontinue\n\t\t}\n\n\t\tresolvedValue := fieldInput.Value\n\t\tif fieldInput.FieldOptionName != \"\" {\n\t\t\tif !strings.EqualFold(dataType, \"single_select\") {\n\t\t\t\treturn nil, nil, fmt.Errorf(\"issue field %q is %q, so field_option_name cannot be used\", fieldInput.FieldName, dataType)\n\t\t\t}\n\n\t\t\toptionFound := false\n\t\t\tfor _, option := range node.IssueFieldSingleSelect.Options {\n\t\t\t\tif strings.EqualFold(strings.TrimSpace(string(option.Name)), strings.TrimSpace(fieldInput.FieldOptionName)) {\n\t\t\t\t\t// REST API expects the option name, not the ID\n\t\t\t\t\tresolvedValue = string(option.Name)\n\t\t\t\t\toptionFound = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif !optionFound {\n\t\t\t\treturn nil, nil, fmt.Errorf(\"issue field option %q was not found for field %q\", fieldInput.FieldOptionName, fieldInput.FieldName)\n\t\t\t}\n\t\t}\n\n\t\tresolved = append(resolved, &github.IssueRequestFieldValue{","sourceCodeStart":356,"sourceCodeEnd":392,"githubUrl":"https://github.com/github/github-mcp-server/blob/0ea1f775a7c73eff1bd2e25904d01136756bbfe2/pkg/github/issues.go#L356-L392","documentation":"resolveIssueRequestFieldValues (pkg/github/issues.go:374) allows field_option_name only on fields whose dataType is single_select. The error fires when the requested field resolved to a text, number, or date field but the caller supplied a field_option_name — only single-select fields have options; other types need a literal value.","triggerScenarios":"update_issue with {\"field_name\":\"Estimate\",\"field_option_name\":\"Large\"} where Estimate is an IssueFieldNumber; {\"field_name\":\"Due Date\",\"field_option_name\":\"Q3\"} where Due Date is IssueFieldDate; the dataType in the metadata is e.g. \"number\" or \"date\", not \"single_select\".","commonSituations":"A field's type changed from single-select to text/number after payloads were written; copy-pasting option syntax across fields; LLMs defaulting to field_option_name for every field.","solutions":["Use value instead: {\"field_name\":\"Estimate\",\"value\":8}","Check the field's type in repo issue-fields settings before choosing value vs field_option_name","If the field should be single-select, change its type in repository settings first"],"exampleFix":"# before (Estimate is a number field)\n{\"issue_fields\": [{\"field_name\": \"Estimate\", \"field_option_name\": \"8\"}]}\n\n# after\n{\"issue_fields\": [{\"field_name\": \"Estimate\", \"value\": 8}]}","handlingStrategy":"validation","validationCode":"meta := fetchRepoIssueFieldMetadata(ctx, gqlClient, owner, repo) // name -> dataType\nfor _, f := range fields {\n    dt, ok := meta[strings.ToLower(strings.TrimSpace(f.FieldName))]\n    if !ok {\n        continue // handled by not-found error\n    }\n    if f.FieldOptionName != \"\" && !strings.EqualFold(dt, \"single_select\") {\n        return fmt.Errorf(\"field %q is %s; use value, not field_option_name\", f.FieldName, dt)\n    }\n}","typeGuard":"func isSingleSelect(dataType string) bool {\n    return strings.EqualFold(strings.TrimSpace(dataType), \"single_select\")\n}","tryCatchPattern":null,"preventionTips":["Encode the rule 'single_select → field_option_name, everything else → value' in your payload builder","Re-check field types after admins reconfigure fields; type changes flip which key is valid","Keep field type metadata alongside cached field names"],"tags":["go","graphql","issue-fields","validation"],"backgroundTag":null,"analyzedSha":"0ea1f775a7c73eff1bd2e25904d01136756bbfe2","analyzedAt":"2026-08-15T18:10:19.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}