{"record":{"id":"bba303178f4b2ad9","repo":"github/github-mcp-server","slug":"issue-field-q-cannot-specify-both-value-and-field","errorCode":null,"errorMessage":"issue field %q cannot specify both value and field_option_name","messagePattern":"issue field %q cannot specify both value and field_option_name","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/github/issues.go","lineNumber":286,"sourceCode":"\t\tdeleteField, _ := OptionalParam[bool](itemMap, \"delete\")\n\t\tvalue, hasValue := itemMap[\"value\"]\n\t\tif hasValue && value == nil {\n\t\t\treturn nil, fmt.Errorf(\"value cannot be null for field %q\", fieldName)\n\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 {","sourceCodeStart":268,"sourceCodeEnd":304,"githubUrl":"https://github.com/github/github-mcp-server/blob/0ea1f775a7c73eff1bd2e25904d01136756bbfe2/pkg/github/issues.go#L268-L304","documentation":"optionalIssueWriteFields (pkg/github/issues.go:286) enforces that a non-delete issue_fields item sets a field by exactly one mechanism: a literal value OR a field_option_name for single-select fields. The error fires when both are present on the same item; the two are ambiguous (is \"P0\" a string value or an option name?).","triggerScenarios":"update_issue with {\"field_name\":\"Priority\",\"value\":\"P0\",\"field_option_name\":\"P0\"} on a single-select field; also mixing value with an option name for text fields.","commonSituations":"LLM-generated args filling every optional property; schema confusion where callers add both 'just to be safe'; templates merged from two examples.","solutions":["For single-select fields keep only field_option_name: {\"field_name\":\"Priority\",\"field_option_name\":\"P0\"}","For text/number/date fields keep only value","Drop the other key entirely — do not send it empty"],"exampleFix":"# before\n{\"issue_fields\": [{\"field_name\": \"Priority\", \"value\": \"P0\", \"field_option_name\": \"P0\"}]}\n\n# after\n{\"issue_fields\": [{\"field_name\": \"Priority\", \"field_option_name\": \"P0\"}]}","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(\"specify either value or field_option_name, not both\")\n    }\n}","typeGuard":"func isSinglePayload(item map[string]any) bool {\n    _, hasValue := item[\"value\"]\n    opt, _ := item[\"field_option_name\"].(string)\n    return !(hasValue && strings.TrimSpace(opt) != \"\")\n}","tryCatchPattern":null,"preventionTips":["Pick field_option_name for single-select fields, value for everything else, at payload-construction time","Drop unused keys rather than sending empty strings — empty field_option_name is treated as absent and can silently change intent","Add a schema-validation step for LLM-generated tool arguments"],"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"}