If I have a GitHub issue number for a pull request, is that the same as the pull request number?

2.1k Views Asked by At

When I create a pull request immediately after an issue, the pull request number is often 1 more than the issue number, which suggests that they share the same counter. As well, the Create an issue comment API seems to be the primary way for commenting back to the main discussion in a pull request, and API requests an issue_number. However, nothing on GitHub officially states that the issue number is equal to the pull request number.

Is there any official documentation or comment that verifies if an issue number for a pull request is equal to its pull request number?

2

There are 2 best solutions below

0
On

Yes, they share the same numbers.

You could also see when changing the number in the url (pull request url or issue url), it will redirect to the correct type (so issue or pull request)

It's some what documented here: https://docs.github.com/en/github/writing-on-github/autolinked-references-and-urls#issues-and-pull-requests

Issue or pull request URL

...

Short link

#26

0
On

Issues, pull requests, and (if enabled) discussions are all numbered from the same pool. If you're using the API, using the pull request number for shared actions is the right thing to do:

Every pull request is an issue, but not every issue is a pull request. For this reason, "shared" actions for both features, like manipulating assignees, labels and milestones, are provided within the Issues API.