Add support for issue fields values to issues.read and issues.write#2551
Add support for issue fields values to issues.read and issues.write#2551kelsey-myers wants to merge 6 commits into
issues.read and issues.write#2551Conversation
Tools tested on this branch
|
| param | type | required | notes |
|---|---|---|---|
owner |
string | yes | repo owner or org login |
repo |
string | no | if omitted, returns org-level fields |
Output: array of issue field definitions
[
{
"id": "IFSS_1",
"full_database_id": 99,
"name": "Priority",
"data_type": "SINGLE_SELECT",
"visibility": "ALL",
"options": [
{ "id": "OPT_1", "name": "High", "color": "red" },
{ "id": "OPT_2", "name": "Low", "color": "blue" }
]
},
{
"id": "IFT_2",
"full_database_id": 42,
"name": "DRI",
"data_type": "TEXT",
"visibility": "ORG_ONLY"
}
]issue_write (create / update)
New input: issue_fields — array of field values to set on the issue. Each item requires field_name and either value or field_option_name (not both).
{
"issue_fields": [
{ "field_name": "Priority", "field_option_name": "High" },
{ "field_name": "DRI", "value": "monalisa" },
{ "field_name": "Due Date", "value": "2026-06-01" }
]
}- Use
field_option_nameforSINGLE_SELECTfields — the server validates the option exists before calling the API - Use
valueforTEXT,NUMBER, andDATEfields
Output: unchanged — { "id": "...", "url": "..." }
issue_read (method: get)
Inputs: unchanged
Output: the response now includes a field_values array alongside the standard issue fields:
{
"number": 123,
"title": "...",
"field_values": [
{ "field_name": "Priority", "value": "High" },
{ "field_name": "DRI", "value": "monalisa" }
]
}The raw issue_field_values from the REST response is replaced with this normalised GraphQL-sourced field_values for consistency with list_issues and search_issues.
…abaseId - Expose fullDatabaseId (BigInt) in list_issue_fields - Add issue_fields parameter to issue_write for setting field values - Support single-select fields via field_option_name resolution - Add REST API field value extraction in get_issue responses - Update minimal types with IssueFieldValue for REST responses Co-authored-by: Copilot <[email protected]>
…turn minimal fields
70e8866 to
7b1b06c
Compare
There was a problem hiding this comment.
Pull request overview
This PR extends the issues tool surface to support reading and writing GitHub Issues 2.0 custom field values, aligning issue_read/issue_write behavior with the newer REST/GraphQL capabilities introduced alongside the go-github upgrade.
Changes:
- Added
issue_fieldsinput toissue_write, including name-based resolution of field IDs and (for single-select) option validation. - Expanded
issue_readoutput handling to include RESTissue_field_values, and added best-effort GraphQL enrichment to normalize tofield_valueswhere possible. - Updated minimal/DTO types and unit tests to cover issue field value parsing and write request shaping.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents the new issue_fields input for issue_write. |
| pkg/github/minimal_types.go | Adds REST-backed minimal issue field value types and separates REST issue_field_values from GraphQL-normalized field_values. |
| pkg/github/issues.go | Implements parsing + GraphQL metadata resolution for issue_fields, wires field values into create/update, and adjusts search/get enrichment paths. |
| pkg/github/issues_test.go | Adds/updates tests for get/write behavior involving issue field values. |
| pkg/github/issue_fields.go | Fetches/stores GraphQL fullDatabaseId for issue fields and adds parsing helper. |
| pkg/github/issue_fields_test.go | Updates expectations to include fullDatabaseId/DatabaseID. |
| pkg/github/toolsnaps/issue_write.snap | Updates tool schema snapshot to include issue_fields. |
| docs/insiders-features.md | Reflects the issue_fields parameter in generated docs. |
| docs/feature-flags.md | Reflects the issue_fields parameter in generated docs. |
Copilot's findings
Comments suppressed due to low confidence (1)
pkg/github/issues.go:1599
searchIssuesHandlernow always performs GraphQL field_values enrichment whenever there are results, and returns an error if GraphQL is unavailable or the query fails. This looks like a regression of the documented behavior ofFeatureFlagIssueFields(which is meant to gate search_issues field_values enrichment); please restore the feature-flag check so search_issues works without GraphQL issue fields features enabled.
var fieldValuesByID map[string][]MinimalFieldValue
if len(result.Issues) > 0 {
gqlClient, err := deps.GetGQLClient(ctx)
if err != nil {
return utils.NewToolResultErrorFromErr(errorPrefix+": failed to get GitHub GraphQL client", err), nil
}
fieldValuesByID, err = fetchIssueFieldValuesByNodeID(ctx, gqlClient, result.Issues)
if err != nil {
return ghErrors.NewGitHubGraphQLErrorResponse(ctx, errorPrefix+": failed to fetch issue field values", err), nil
}
}
- Files reviewed: 9/9 changed files
- Comments generated: 2
…ds schema with oneOf
Summary
This PR is passing issue field values to the issue write & read tools, which now (after #2452) support this.
issues_writeis using that endpointWhy
What changed
MCP impact
Prompts tested (tool changes only)
Security / limits
Tool renaming
deprecated_tool_aliases.goNote: if you're renaming tools, you must add the tool aliases. For more information on how to do so, please refer to the official docs.
Lint & tests
./script/lint./script/testDocs