github/github-mcp-server · error

issue field %q is %q, so field_option_name cannot be used

Error message

issue field %q is %q, so field_option_name cannot be used

What it means

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.

Source

Thrown at pkg/github/issues.go:374

		case "IssueFieldSingleSelect":
			fullDatabaseIDStr = string(node.IssueFieldSingleSelect.FullDatabaseID)
			dataType = string(node.IssueFieldSingleSelect.DataType)
		}

		fieldID := parseFullDatabaseID(fullDatabaseIDStr)
		if fieldID == 0 {
			return nil, nil, fmt.Errorf("issue field %q is missing fullDatabaseId", fieldInput.FieldName)
		}

		if fieldInput.Delete {
			fieldIDsToDelete = append(fieldIDsToDelete, fieldID)
			continue
		}

		resolvedValue := fieldInput.Value
		if fieldInput.FieldOptionName != "" {
			if !strings.EqualFold(dataType, "single_select") {
				return nil, nil, fmt.Errorf("issue field %q is %q, so field_option_name cannot be used", fieldInput.FieldName, dataType)
			}

			optionFound := false
			for _, option := range node.IssueFieldSingleSelect.Options {
				if strings.EqualFold(strings.TrimSpace(string(option.Name)), strings.TrimSpace(fieldInput.FieldOptionName)) {
					// REST API expects the option name, not the ID
					resolvedValue = string(option.Name)
					optionFound = true
					break
				}
			}

			if !optionFound {
				return nil, nil, fmt.Errorf("issue field option %q was not found for field %q", fieldInput.FieldOptionName, fieldInput.FieldName)
			}
		}

		resolved = append(resolved, &github.IssueRequestFieldValue{

View on GitHub (pinned to 0ea1f775a7)

Solutions

  1. Use value instead: {"field_name":"Estimate","value":8}
  2. Check the field's type in repo issue-fields settings before choosing value vs field_option_name
  3. If the field should be single-select, change its type in repository settings first

Example fix

# before (Estimate is a number field)
{"issue_fields": [{"field_name": "Estimate", "field_option_name": "8"}]}

# after
{"issue_fields": [{"field_name": "Estimate", "value": 8}]}
Defensive patterns

Strategy: validation

Validate before calling

meta := fetchRepoIssueFieldMetadata(ctx, gqlClient, owner, repo) // name -> dataType
for _, f := range fields {
    dt, ok := meta[strings.ToLower(strings.TrimSpace(f.FieldName))]
    if !ok {
        continue // handled by not-found error
    }
    if f.FieldOptionName != "" && !strings.EqualFold(dt, "single_select") {
        return fmt.Errorf("field %q is %s; use value, not field_option_name", f.FieldName, dt)
    }
}

Type guard

func isSingleSelect(dataType string) bool {
    return strings.EqualFold(strings.TrimSpace(dataType), "single_select")
}

Prevention

When it happens

Trigger: 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".

Common situations: 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.

Related errors


AI-assisted analysis of github/github-mcp-server@0ea1f775a7 (2026-08-15). Data as JSON: /api/errors/b733ef2fc9db18c6. Report an issue: GitHub.