Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to provide stateReason to --json flag of issue view #8782

Closed
andyatmiami opened this issue Mar 2, 2024 · 2 comments · Fixed by #9080
Closed

Unable to provide stateReason to --json flag of issue view #8782

andyatmiami opened this issue Mar 2, 2024 · 2 comments · Fixed by #9080
Labels
enhancement a request to improve CLI gh-issue relating to the gh issue command help wanted Contributions welcome

Comments

@andyatmiami
Copy link

andyatmiami commented Mar 2, 2024

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

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

  1. $ gh issue view -R owner/repo/73 --json closed,closedAt,state,stateReason
  2. 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
    
  3. 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)
@andyatmiami andyatmiami added the bug Something isn't working label Mar 2, 2024
@cliAutomation cliAutomation added the needs-triage needs to be reviewed label Mar 2, 2024
@andyatmiami
Copy link
Author

I realize the state_reason can be retrieved via gh api as such:

  • gh api repos/{owner}/{repo}/issues/73

But I would claim the state_reason field is an vital piece of information in understanding the state.

If state is an available field, I feel its essential for the same reasoning that state_reason be supported.

@andyatmiami andyatmiami changed the title Unable to provision stateReason to --json flag of issue view Unable to provide stateReason to --json flag of issue view Mar 2, 2024
@mxie mxie added help wanted Contributions welcome gh-issue relating to the gh issue command and removed needs-triage needs to be reviewed labels Apr 30, 2024
@mxie
Copy link

mxie commented Apr 30, 2024

Thanks @andyatmiami! This seems like a reasonable ask, and I appreciate that you found it's available via gh api at least. 👍 Marking this with help wanted to open this work up to you or other folks to to add support!

@mxie mxie added enhancement a request to improve CLI and removed bug Something isn't working labels Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement a request to improve CLI gh-issue relating to the gh issue command help wanted Contributions welcome
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants