Include custom issue field values in list_issues response#2466
Open
kelsey-myers wants to merge 2 commits into
Open
Include custom issue field values in list_issues response#2466kelsey-myers wants to merge 2 commits into
kelsey-myers wants to merge 2 commits into
Conversation
Adds Issues 2.0 custom field values to each issue returned by the
list_issues GraphQL query, exposed on MinimalIssue as field_values:
[{field, value}]. Filtering by field is a separate concern (needs the
GraphQL IssueFilters input updated upstream) and is not included here.
shurcooL/graphql's response decoder walks every inline fragment of a
union regardless of __typename, so IssueFieldNumberValue.value is
aliased to valueNumber to avoid a Float-vs-String type clash when the
runtime variant is, e.g., a SingleSelectValue.
cac6781 to
b57cd61
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the list_issues tool’s issue output (MinimalIssue) to include GitHub Issues 2.0 custom issue field values (e.g., Priority/Impact) by selecting issueFieldValues(first: 25) in the GraphQL query and flattening the union results into a minimal {field, value} shape.
Changes:
- Add
field_values(array of{field, value, values}) toMinimalIssueand populate it when converting GraphQL fragments. - Introduce GraphQL fragment structs (
IssueFieldRef,IssueFieldValueFragment) to read field names/values across the union types. - Update
list_issuestests to includeissueFieldValuesin mocked responses and expected query strings.
Show a summary per file
| File | Description |
|---|---|
| pkg/github/minimal_types.go | Adds MinimalIssue.FieldValues and conversion logic to flatten custom field values into the minimal response shape. |
| pkg/github/issues.go | Extends the IssueFragment GraphQL selection with issueFieldValues(first: 25) and adds supporting fragment types for union decoding. |
| pkg/github/issues_test.go | Updates mocked GraphQL responses/expected queries and asserts field_values flattening for list_issues. |
Copilot's findings
- Files reviewed: 3/3 changed files
- Comments generated: 1
86654e4 to
0fccfb0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Issues 2.0 custom field values (Priority, Visibility, Impact, etc.) to each issue returned by
list_issues, exposed onMinimalIssueasfield_values: [{field, value}].Why
Issues 2.0 introduced custom fields (single-select, number, text, date) that are core to how teams triage and prioritise. Without them in the MCP response, an agent can list issues but has no way to see — or reason about — the values teams actually filter and sort by in the GitHub UI.
Fixes https://github.com/github/plan-track-agentic-toolkit/issues/121
What changed
IssueFragmentnow selectsissueFieldValues(first: 25)(matches monolithIssueField::ORGANIZATION_ISSUE_FIELDS_LIMIT).IssueFieldReftype with aName()method, resolving the field name across the 4-variantIssueFieldsunion.IssueFieldValueFragmentunion fragment overIssueFieldDate|Number|SingleSelect|Text Value.MinimalIssuegainsFieldValues []MinimalIssueFieldValue(omitempty); each entry carriesfield,value, and a forward-compatvalues []stringfor the upcomingIssueFieldMultiSelectValue(see github/github#430793).fragmentToMinimalIssueFieldValueconverts the fragment to the minimal shape.Live validation
Smoke-tested against production github.com via a local build of this server, against
github/issues:{ "number": 21640, "field_values": [ {"field":"Priority","value":"P2"}, {"field":"Visibility","value":"Medium"}, {"field":"Impact","value":"Medium"}, {"field":"Effort","value":"Medium"} ]}MCP impact
list_issuesresponse now includes an optionalfield_valuesarray per issue. Additive only, omitted for issues without custom field values, so existing consumers aren't broken.Prompts tested (tool changes only)
github/issuesand tell me which ones are P1." — agent can now answer from the response without follow-up tool calls.github/issues?"Security / limits
first: 25caps the per-issue field array at the same limit the dotcom monolith enforces (ORGANIZATION_ISSUE_FIELDS_LIMIT). No new auth surface — the values are scoped to the samerepopermission the existing query already requires.Tool renaming
deprecated_tool_aliases.goLint & tests
./script/lint./script/testDocs