-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Closed
Labels
enhancementa request to improve CLIa request to improve CLIgh-issuerelating to the gh issue commandrelating to the gh issue commandhelp wantedContributions welcomeContributions welcome
Description
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):
cli/pkg/cmd/issue/view/view.go
Line 81 in 9dd102f
"assignees", "labels", "projectCards", "reactionGroups", "lastComment", "stateReason", Line 30 in 9dd102f
StateReason string Line 238 in 9dd102f
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)
Metadata
Metadata
Assignees
Labels
enhancementa request to improve CLIa request to improve CLIgh-issuerelating to the gh issue commandrelating to the gh issue commandhelp wantedContributions welcomeContributions welcome