Describe the bug
The state_reason issue attribute cannot be provided to the --json parameter of the issue view command.
The state_reason Issue attribute is referenced in numerous files (not complete list):
|
"assignees", "labels", "projectCards", "reactionGroups", "lastComment", "stateReason", |
-
|
StateReason string `json:"state_reason"` |
- etc
It was also discussed in this Issue:
All discussion makes it appear that stateReason is a supported field. However, it is not defined in the Available fields listed when providing an invalid --json value.
Steps to reproduce the behavior
$ gh issue view -R owner/repo/73 --json closed,closedAt,state,stateReason
- View the output:
Unknown JSON field: "stateReason"
Available fields:
assignees
author
body
closed
closedAt
comments
createdAt
id
labels
milestone
number
projectCards
projectItems
reactionGroups
state
title
updatedAt
url
- See error
Expected vs actual behavior
Expected: state_reason Issue field should able to be returned by specifying stateReason within the --json flag
Actual: error stating stateReason is not an available field.
Logs
$ gh version
gh version 2.44.1 (2024-02-16)
Describe the bug
The
state_reasonissue attribute cannot be provided to the--jsonparameter of theissueviewcommand.The
state_reasonIssue attribute is referenced in numerous files (not complete list):cli/pkg/cmd/issue/view/view.go
Line 81 in 9dd102f
cli/api/queries_issue.go
Line 30 in 9dd102f
cli/pkg/search/result.go
Line 238 in 9dd102f
It was also discussed in this Issue:
All discussion makes it appear that
stateReasonis a supported field. However, it is not defined in theAvailable fieldslisted when providing an invalid--jsonvalue.Steps to reproduce the behavior
$ gh issue view -R owner/repo/73 --json closed,closedAt,state,stateReasonExpected vs actual behavior
Expected:
state_reasonIssuefield should able to be returned by specifyingstateReasonwithin the--jsonflagActual: error stating
stateReasonis not an available field.Logs