Skip to content
Discussion options

You must be logged in to vote

Hi, GitHub CLI doesn't implement this yet, but you should be able to fetch linked issues like so:

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'

Replace "PRNUMBER" with the number of your PR and, unless running from within a local git repository, replace placeholders {owner} and {repo} with your own repository.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@nick-fields
Comment options

Answer selected by nick-fields
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants