On the github website, a lot of issues are connected(referenced) with pull request or commits. Is there a way we can find the connection in the github archive database or in the github API?
2 Answers
There is no way to request issues or commits that are linked via numbering. I'm guessing that you want something to show you when a commit message has something akin to "Fixes #13" and give you the commit and the issue. That is not possible. As best I know (and as the API is currently documented) this is impossible without parsing commit messages and issue/issue comment bodies yourself. This would be rather exhaustive and altogether unreliable in most cases. Some of those may not reference GitHub issues even though the source is on GitHub.
You can always see if they'll entertain the request though by contacting GitHub

- 26,944
- 4
- 67
- 72
When you are querying a pull request through the GitHub V3 Pull Request API, you do see a reference to an issue, and a commit:
GET /repos/:owner/:repo/pulls/:number
Response
Status: 200 OK
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
{
"url": "https://api.github.com/octocat/Hello-World/pulls/1",
"html_url": "https://github.com/octocat/Hello-World/pulls/1",
"diff_url": "https://github.com/octocat/Hello-World/pulls/1.diff",
"patch_url": "https://github.com/octocat/Hello-World/pulls/1.patch",
"issue_url": "https://github.com/octocat/Hello-World/issue/1",
"number": 1,
"state": "open",
"title": "new-feature",
"body": "Please pull these awesome changes",
"created_at": "2011-01-26T19:01:12Z",
"updated_at": "2011-01-26T19:01:12Z",
"closed_at": "2011-01-26T19:01:12Z",
"merged_at": "2011-01-26T19:01:12Z",
"head": {
"label": "new-topic",
"ref": "new-topic",
"sha": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
...
That is one way to get the association you are after, from a given pull request.

- 1,262,500
- 529
- 4,410
- 5,250
-
1I think OP means references in the body of a pull request, comment or commit, not the association between pull request and issue numbers. – Ian Stapleton Cordasco Apr 27 '13 at 15:07
-
Actually, i did mean the associations;I want to be able to track from one issue, to one or more pull requests that are referenced to the issue, and all the commits that are refereneced to that issue too. I was hoping to see if I could get it, but I cant. From VonC's answer,i did see an "issue url", but the way it works is like this: When there is a pull, it is considered as an issue too, so when you use the url link, it actually takes you to the pull request itself. Like this: https://github.com/twitter/bootstrap/issues/7708 – Deng Tianjie Apr 27 '13 at 23:31