Skip to content

Add support for issue fields values to issues.read and issues.write#2492

Open
iulia-b wants to merge 4 commits into
github:mainfrom
iulia-b:iunia/reapply-issue-field-commits
Open

Add support for issue fields values to issues.read and issues.write#2492
iulia-b wants to merge 4 commits into
github:mainfrom
iulia-b:iunia/reapply-issue-field-commits

Conversation

@iulia-b
Copy link
Copy Markdown
Contributor

@iulia-b iulia-b commented May 18, 2026

Summary

This PR is passing issue field values to the issue write & read tools, which now (after #2452) support this.

Why

What changed

  • the go-gothub lib was updated to pass issue field value sto rest api
  • the repo upgraded to use v0.87 of go-github
  • we're now using new params for IssueFieldValues

MCP impact

  • No tool or API changes
  • Tool schema or behavior changed
  • New tool added

Prompts tested (tool changes only)

  • added tests to make sure that passing fields works, as well as retrieving them

Security / limits

  • No security or limits impact
  • Auth / permissions considered
  • Data exposure, filtering, or token/size limits considered

Tool renaming

  • I am renaming tools as part of this PR (e.g. a part of a consolidation effort)
    • I have added the new tool aliases in deprecated_tool_aliases.go
  • I am not renaming tools as part of this PR

Note: 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

  • Linted locally with ./script/lint
  • Tested locally with ./script/test

Docs

  • Not needed
  • Updated (README / docs / examples)

@iulia-b iulia-b self-assigned this May 18, 2026
@iulia-b iulia-b marked this pull request as ready for review May 18, 2026 13:32
@iulia-b iulia-b requested a review from a team as a code owner May 18, 2026 13:32
Copilot AI review requested due to automatic review settings May 18, 2026 13:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR wires the new IssueFieldValues support (added by the go-github v0.87 upgrade in PR #2452) into the issue_write and issue_read tools. On write, users can pass an issue_fields array specifying field names plus either a raw value or a single-select option name; the server resolves names → IDs via a GraphQL metadata query before calling the REST API. On read, custom field values are now surfaced in the trimmed MinimalIssue output.

Changes:

  • Adds issue_fields input parameter to issue_write (create/update), including a GraphQL-based resolver that maps field/option names to database IDs.
  • Extends MinimalIssue with an issue_field_values array (including single-select option details) populated from the REST response.
  • Updates README, toolsnap, and unit tests covering the new read/write behavior.
Show a summary per file
File Description
pkg/github/issues.go Adds input parsing (optionalIssueWriteFields) and GraphQL-based name→ID resolution; threads IssueFieldValues through CreateIssue/UpdateIssue.
pkg/github/minimal_types.go New MinimalIssueFieldValue/MinimalIssueFieldValueSingleSelectOption types and conversion logic.
pkg/github/issues_test.go Adds tests for reading field values and writing with field-name resolution, plus validation error case.
pkg/github/toolsnaps/issue_write.snap Snapshot updated for the new issue_fields schema entry.
README.md Documents the new issue_fields parameter for issue_write.

Copilot's findings

  • Files reviewed: 5/5 changed files
  • Comments generated: 2

Comment thread pkg/github/issues.go
Comment on lines +60 to +66
type issueFieldMetadataQuery struct {
Repository struct {
IssueFields struct {
Nodes []issueFieldMetadataNode
} `graphql:"issueFields(first: 100)"`
} `graphql:"repository(owner: $owner, name: $repo)"`
}
Comment thread pkg/github/issues.go
issueFields := make([]IssueWriteFieldInput, 0, len(inputMaps))
for _, itemMap := range inputMaps {
fieldName, err := RequiredParam[string](itemMap, "field_name")
if err != nil || strings.TrimSpace(fieldName) == "" {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants