Skip to content

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

@andyatmiami

Description

@andyatmiami

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementa request to improve CLIgh-issuerelating to the gh issue commandhelp wantedContributions welcome

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions