How can I find out what pull request is associated with the issue with the Get an issue API?

Hi,

GitHub API Doc says that Get an Issue’s Default Response contains what pull request is associated with the issue as pull_request attribute.

I tried using the API but the response does not include pull_request attribute.

% GITHUB_API_ACCEPT_HEADER="Accept: application/vnd.github.v3+json"
% GITHUB_API_AUTH_HEADER="Authorization: token $TOKEN"
% curl -sS -H "$GITHUB_API_ACCEPT_HEADER" -H "$GITHUB_API_AUTH_HEADER" https://api.github.com/repos/cm-rwakatsuki/public_test/issues/1
{
  "url": "https://api.github.com/repos/cm-rwakatsuki/public_test/issues/1",
  "repository_url": "https://api.github.com/repos/cm-rwakatsuki/public_test",
  "labels_url": "https://api.github.com/repos/cm-rwakatsuki/public_test/issues/1/labels{/name}",
  "comments_url": "https://api.github.com/repos/cm-rwakatsuki/public_test/issues/1/comments",
  "events_url": "https://api.github.com/repos/cm-rwakatsuki/public_test/issues/1/events",
  "html_url": "https://github.com/cm-rwakatsuki/public_test/issues/1",
  "id": 736626832,
  "node_id": "MDU6SXNzdWU3MzY2MjY4MzI=",
  "number": 1,
  "title": "issue 1",
  "user": {...},
  "labels": [

  ],
  "state": "open",
  "locked": false,
  "assignee": null,
  "assignees": [

  ],
  "milestone": null,
  "comments": 0,
  "created_at": "2020-11-05T05:32:48Z",
  "updated_at": "2020-11-05T05:32:48Z",
  "closed_at": null,
  "author_association": "OWNER",
  "active_lock_reason": null,
  "body": "",
  "closed_by": null,
  "performed_via_github_app": null
}

How can I find out what pull request is associated with the issue with the Get an issue API?

Hi @cm-rwakatsuki :wave:

Thanks so much for joining our Community, and for your post!

From what I can tell, there is nothing incorrect that you’re doing to cause this behavior. I’ve checked the database entry for your issue, and I see that we have no linked Pull Request(s) associated with its record.

It’s not currently clear why, but for the process of identifying PRs that link to issues, you are doing what we would expect to provide that data.

I’ve performed a sync action against the PR but unfortunately, that hasn’t kicked it into alignment like we would normally expect. Since this is a functional test, I can assume there isn’t much urgency behind this but right now, I’m not sure what’s going on.

I do have a question out to the team as to what I’m missing but for now, we don’t have a backend record linking the PR and issue, which should populate the returned pull_request value.

If anything comes back from our team with actionable info, I will be sure to update this thread.