Tamlyn
Tamlyn

Reputation: 23582

Get date of review request from GitHub API

How do I get the timestamp at which a PR review was request/re-requested? It shows as an event in the conversations tab in a PR so it must exist somewhere.

enter image description here

The pulls API endpoint show who has been requested to review but I can't see when.

 "requested_reviewers": [
    {
      "login": "tamlyn",
       ...
    },
  ],

Any ideas?

Upvotes: 1

Views: 198

Answers (1)

Adil B
Adil B

Reputation: 16826

You're looking for the GitHub Timeline API. See the docs for the Timeline API here.

Request:

curl \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  https://api.github.com/repos/OWNER/REPO/issues/ISSUE_NUMBER/timeline

Response:

...
{
        "id": "12345",
        ...
        "actor": {
            "login": "user",
            ...
        },
        "event": "review_requested",
        "created_at": "2022-01-01T01:01:01Z",
        ...
        "review_requester": {
            "login": "user",
            ...
        },
        "requested_reviewer": {
            "login": "user2",
            ...
        },
        ...
},
...

Upvotes: 1

Related Questions