Skip to content

Add field to retrieve linked issues (closingIssuesReferences) in gh pr view <number>  #10529

@vvolkgang

Description

@vvolkgang

Describe the feature or problem you’d like to solve

Access to issues linked to Pull Requests in the Development panel. This field is available in GraphQL but not yet exposed in gh CLI. The GraphQL query to retrieve this field was shared in #7097

gh api graphql -F owner='{owner}' -F repo='{repo}' -F pr=PRNUMBER -f query='
query ($owner: String!, $repo: String!, $pr: Int!) {
	repository(owner: $owner, name: $repo) {
		pullRequest(number: $pr) {
			closingIssuesReferences(first: 100) {
				nodes {
					number
				}
			}
		}
	}
}'  --jq '.data.repository.pullRequest.closingIssuesReferences.nodes[].number'

Proposed solution

Exposing closingIssuesReferences as a field. E.g. gh view pr <number> --json closingIssuesReferences.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementa request to improve CLIgh-prrelating to the gh pr commandhelp wantedContributions welcome

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions