Repository navigation
Add field to retrieve linked issues (closingIssuesReferences) in gh pr view <number> #10529
Description
Activity
- changed the title
[-]Add field to retrieve linked issues in `gh pr view`[/-][+]Add field to retrieve linked issues (`closingIssuesReferences`) in `gh pr view <number>` [/+]on Mar 3, 2025 Hey @vvolkgang, seems reasonable. Thanks for the suggestion!
Acceptance Criteria
Given an PR references an issue to close
when I usegh pr view <number> --json closingIssueReferences[, other fields...]
then I get a JSON object containing an array of the closingIssuesReferences with issue numbers$ gh pr view 101 --json title,number,closingIssueReferences { "title": "PR title", "number": 101, "closingIssueReferences": [ 98, 99 ] }Reacted by Álison Fernandes- addedhelp wantedContributions welcomeContributions welcomegh-prrelating to the gh pr commandrelating to the gh pr commandand removedneeds-triageneeds to be reviewedneeds to be reviewed
on Mar 4, 2025 Are we looking to have the opposite:
gh issue viewthat shows which PRs would close the issue?
Or do we have that already and I'm blind?Are we looking to have the opposite:
gh issue viewthat shows which PRs would close the issue? Or do we have that already and I'm blind?HI @EdouardF, I don't think this field exists for
gh issue view, so I suppose we could add that enhancement as well. Will you make another issue for it and link this one?Reacted by Edouard Forgeau-Martel@williammartin @iamazeem As of our discussion in the PR #10544, here's the updated acceptance criteria:
Acceptance Criteria
Given an PR references an issue to close
when I usegh pr view <number> --json closingIssueReferences[, other fields...]
then I get a JSON object containingclosingIssuesReferencesas an array of referenced issues with sufficient details to locate the issue:$ gh pr view 101 --json title,number,closingIssueReferences { "title": "PR title", "number": 101, "closingIssuesReferences": [ { "number": 999, "id": "issue-id", "url": "https://github.com/...", "repository": { "id": "repo-id", "name": "repo-name", "owner": { "id": "owner-id", "login": "owner-login" } } } ] }Note that the nested structure (for
repositoryandownerfields) is mainly to keep the schema consistent withgh repo view --jsonoutput.Reacted by Azeem
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
Proposed solution
Exposing
closingIssuesReferencesas a field. E.g.gh view pr <number> --json closingIssuesReferences.