Skip to content

feat: Add issue field values support for write and read#4200

Merged
gmlewis merged 1 commit intogoogle:masterfrom
iulia-b:iunia/issue-field-values-support
May 8, 2026
Merged

feat: Add issue field values support for write and read#4200
gmlewis merged 1 commit intogoogle:masterfrom
iulia-b:iunia/issue-field-values-support

Conversation

@iulia-b
Copy link
Copy Markdown
Contributor

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

Issue Fields are a new feature that is about to GA for GitHub. The Rest API provides support for reading fields on an issue or setting them, as mentioned in #4194.

Updating the structures in this lib will enable support for fields for all the consumers, enabling discovery of this feature.

@google-cla
Copy link
Copy Markdown

google-cla Bot commented May 8, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Copy Markdown

@alondahari alondahari left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍🏼

@iulia-b iulia-b marked this pull request as ready for review May 8, 2026 11:50
@codecov
Copy link
Copy Markdown

codecov Bot commented May 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.71%. Comparing base (144172e) to head (c2abcff).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4200   +/-   ##
=======================================
  Coverage   93.71%   93.71%           
=======================================
  Files         209      209           
  Lines       19772    19772           
=======================================
  Hits        18529    18529           
  Misses       1046     1046           
  Partials      197      197           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

Thank you, @iulia-b and @alondahari!
LGTM.
Merging.

@gmlewis gmlewis changed the title Add issue field values support for write and read feat: Add issue field values support for write and read May 8, 2026
@gmlewis gmlewis merged commit 6b805b3 into google:master May 8, 2026
10 checks passed
Comment thread github/issues.go

// IssueFieldValueSingleSelectOption represents a single-select option for an issue field value.
//
// GitHub API docs: https://docs.github.com/rest/issues/issues#get-an-issue
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
// GitHub API docs: https://docs.github.com/rest/issues/issues#get-an-issue
// GitHub API docs: https://docs.github.com/rest/issues/issues?apiVersion=2022-11-28#get-an-issue

Comment thread github/issues.go
// The Value field contains a string for text, single_select, and date fields,
// or a number for numeric fields.
//
// GitHub API docs: https://docs.github.com/rest/issues/issues#get-an-issue
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
// GitHub API docs: https://docs.github.com/rest/issues/issues#get-an-issue
// GitHub API docs: https://docs.github.com/rest/issues/issues?apiVersion=2022-11-28#get-an-issue

Comment thread github/issues.go
Comment on lines +131 to +133
ID *int64 `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
Color *string `json:"color,omitempty"`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These fields are all required:

Suggested change
ID *int64 `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
Color *string `json:"color,omitempty"`
ID int64 `json:"id"`
Name string `json:"name"`
Color string `json:"color"`

See

          "single_select_option": {
            "description": "Details about the selected option (only present for single_select fields)",
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "description": "Unique identifier for the option.",
                "type": "integer",
                "format": "int64"
              },
              "name": {
                "description": "The name of the option",
                "type": "string"
              },
              "color": {
                "description": "The color of the option",
                "type": "string"
              }
            },
            "required": [
              "id",
              "name",
              "color"
            ]
          }

Comment thread github/issues.go
Comment on lines +142 to +145
IssueFieldID *int64 `json:"issue_field_id,omitempty"`
NodeID *string `json:"node_id,omitempty"`
DataType *string `json:"data_type,omitempty"`
Value any `json:"value,omitempty"`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All these fields are required according to the schema:

Suggested change
IssueFieldID *int64 `json:"issue_field_id,omitempty"`
NodeID *string `json:"node_id,omitempty"`
DataType *string `json:"data_type,omitempty"`
Value any `json:"value,omitempty"`
IssueFieldID int64 `json:"issue_field_id"`
NodeID string `json:"node_id"`
DataType string `json:"data_type"`
Value any `json:"value"`

@gmlewis
Copy link
Copy Markdown
Collaborator

gmlewis commented May 8, 2026

Whups, my bad. I apologize.
Thank you, @alexandear for catching these issues.

@iulia-b - can you please open a new PR to address these issues?

Comment thread github/issues.go
Milestone *int `json:"milestone,omitempty"`
Assignees *[]string `json:"assignees,omitempty"`
Type *string `json:"type,omitempty"`
IssueFieldValues []*IssueFieldValue `json:"issue_field_values,omitempty"`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think we can add []*IssueFieldValue to IssueRequest, We should create a new struct for it bcuz
IssueFieldValue have these field -

  • issue_field_id (required)
  • node_id (required)
  • data_type (required)
  • value (required)
  • single_select_option

Whereas issue_field_values only accepts the following fields in the array

  • field_id (required)
  • value (required)
Image

https://docs.github.com/en/rest/issues/issues?apiVersion=2022-11-28#update-an-issue

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.

Add IssuFieldValues support for Issues

5 participants