github/github-mcp-server · error

issue field %q was not found in %s/%s

Error message

issue field %q was not found in %s/%s

What it means

resolveIssueRequestFieldValues (pkg/github/issues.go:342) matches each requested field_name (lowercased and trimmed) against the repository's issue fields returned by the metadata query. This error fires when no configured field matches — the field genuinely does not exist in owner/repo, so its database ID cannot be resolved and the write is aborted before any mutation.

Source

Thrown at pkg/github/issues.go:342

			name = string(node.IssueFieldText.Name)
		case "IssueFieldNumber":
			name = string(node.IssueFieldNumber.Name)
		case "IssueFieldDate":
			name = string(node.IssueFieldDate.Name)
		case "IssueFieldSingleSelect":
			name = string(node.IssueFieldSingleSelect.Name)
		default:
			continue
		}
		fieldByName[strings.ToLower(strings.TrimSpace(name))] = node
	}

	resolved := make([]*github.IssueRequestFieldValue, 0, len(issueFields))
	var fieldIDsToDelete []int64
	for _, fieldInput := range issueFields {
		node, ok := fieldByName[strings.ToLower(strings.TrimSpace(fieldInput.FieldName))]
		if !ok {
			return nil, nil, fmt.Errorf("issue field %q was not found in %s/%s", fieldInput.FieldName, owner, repo)
		}

		var fullDatabaseIDStr, dataType string
		switch string(node.TypeName) {
		case "IssueFieldText":
			fullDatabaseIDStr = string(node.IssueFieldText.FullDatabaseID)
			dataType = string(node.IssueFieldText.DataType)
		case "IssueFieldNumber":
			fullDatabaseIDStr = string(node.IssueFieldNumber.FullDatabaseID)
			dataType = string(node.IssueFieldNumber.DataType)
		case "IssueFieldDate":
			fullDatabaseIDStr = string(node.IssueFieldDate.FullDatabaseID)
			dataType = string(node.IssueFieldDate.DataType)
		case "IssueFieldSingleSelect":
			fullDatabaseIDStr = string(node.IssueFieldSingleSelect.FullDatabaseID)
			dataType = string(node.IssueFieldSingleSelect.DataType)
		}

View on GitHub (pinned to 0ea1f775a7)

Solutions

  1. List the repository's issue fields first (repo settings, or the metadata query) and use the exact configured name
  2. Match is case-insensitive and whitespace-trimmed — fix pure typos only
  3. If fields were renamed, update the payload to the new name
  4. If the repo has no fields, configure them in repository settings before calling update_issue with issue_fields

Example fix

# before
{"issue_fields": [{"field_name": "Prioroty", "field_option_name": "P0"}]}

# after
{"issue_fields": [{"field_name": "Priority", "field_option_name": "P0"}]}
Defensive patterns

Strategy: validation

Validate before calling

// fetch configured field names once, then diff
known := fetchRepoIssueFieldNames(ctx, gqlClient, owner, repo) // lowercased set
for _, f := range requestedFields {
    if !known[strings.ToLower(strings.TrimSpace(f))] {
        return fmt.Errorf("field %q not configured in %s/%s; available: %v", f, owner, repo, known)
    }
}

Type guard

func isKnownField(name string, known map[string]bool) bool {
    return known[strings.ToLower(strings.TrimSpace(name))]
}

Prevention

When it happens

Trigger: update_issue with field_name "priority" when the repo's field is named "Priority" is fine (case-insensitive) — but "Prioroty" (typo), "Priority Level" (renamed), or a field defined in a different repo/organization template fails. Also when the repo has zero issue fields configured.

Common situations: Fields renamed or removed by admins after scripts were written; copying tool payloads between repos with different field sets; issue-fields preview returning an incomplete list; typo'd names from LLM args.

Related errors


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