Get GitHub pull request
get_github_pull_requestRetrieve full details of a linked GitHub pull request: body, diff stats, comments, CI check runs, and linked work packages.
Instructions
Read one linked GitHub pull request in full, including its CI check runs.
Use it after get_work_package_git_activity when the summary is not enough: this
adds the pull-request body (markdown), the diff size (additions, deletions,
changed_files), comment counts, who merged it, and every work package the PR is
linked to — plus the same check_runs with status and conclusion.
Pitfalls. github_pull_request_id is OpenProject's id, never the GitHub number; the
two are unrelated and there is no lookup by GitHub number. The record is a mirror
that OpenProject refreshes from GitHub webhooks, so updated_at is when OpenProject
last synced, not when GitHub changed. A 404 usually means the id came from the wrong
field or the GitHub module is not installed on this instance.
A pull request appears in OpenProject only when its description or a comment mentions 'OP#123' or the full work-package URL; commits link separately via 'refs #123' in the commit message. Neither link can be created through the API.
Cross-references: find the id with get_work_package_git_activity(work_package_id=…);
GitLab merge requests have no per-id tool — they come back in full from that same
call.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| github_pull_request_id | Yes | The **OpenProject-internal** pull-request id — the 'id' field of an entry in get_work_package_git_activity's github_pull_requests. It is NOT the GitHub PR number ('number' in that same entry, the '#481' on github.com); passing the GitHub number fetches the wrong record or 404s. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | OpenProject-internal id. This is what get_github_pull_request takes — NOT the GitHub/GitLab number. | |
| body | No | Pull-request description as markdown (raw); html is dropped. | |
| draft | No | True while marked draft / work in progress. | |
| state | No | Provider state verbatim: GitHub 'open'/'closed', GitLab 'opened'/'closed'/'merged'/'locked'. Check 'merged' for the merge fact. | |
| title | No | Pull/merge request title. | |
| author | No | Provider account that opened it ({id, name}); a GitHub/GitLab user, not an OpenProject user. | |
| labels | No | Label names; always a list, empty when unlabelled. | |
| merged | No | True once merged; a closed request may never have merged. | |
| number | No | The number humans use on GitHub/GitLab (the '#481' in the PR title). Never pass it to get_github_pull_request. | |
| html_url | No | Provider URL of the request. | |
| additions | No | Lines added across the diff. | |
| deletions | No | Lines removed across the diff. | |
| merged_at | No | ISO 8601 UTC merge time, if merged. | |
| merged_by | No | Provider account that merged it. | |
| check_runs | No | CI check runs GitHub reported for this pull request; always a list. | |
| created_at | No | ISO 8601 UTC creation time. | |
| repository | No | Repository slug, e.g. 'acme/web'. | |
| updated_at | No | ISO 8601 UTC time OpenProject last synced this record. | |
| changed_files | No | Number of files touched. | |
| work_packages | No | Work packages this pull request is linked to; a PR may reference several. | |
| comments_count | No | Issue-style comments. | |
| review_comments_count | No | Inline review comments. |