> For the complete documentation index, see [llms.txt](https://help.swarmia.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.swarmia.com/data-model/entities/pull-request.md).

# Pull request

Pull requests represent work items in your code repository (such as GitHub, GitLab, etc.).

## Properties

### ID

`id` - [uuid](/data-model/types/uuid.md)

ID of the pull request.

### Timestamp

`timestamp` - [timestamp](/data-model/types/timestamp.md)

Time when the pull request was closed or merged. For open pull requests, their creation time will be used.

### Data source

`dataSource` - [CodeDataSource](/data-model/types/enum/codedatasource.md)

Data source of the pull request (such as GitHub, GitLab, etc.).

### Source URL

`sourceUrl` - [url](/data-model/types/url.md)

URL of the pull request on the source installation.

### Number

`number` - [int](/data-model/types/int.md)

Number of the pull request on the source system. These are unique within a repository.

### Title

`title` - [text](/data-model/types/text.md)

Title of the pull request.

### Body

`body` - [text](/data-model/types/text.md) | null

Body/description of the pull request.

### Archived at

`archivedAt` - [timestamp](/data-model/types/timestamp.md) | null

Timestamp when the pull request was archived.

### Source branch

`sourceBranch` - [text](/data-model/types/text.md)

Branch of the pull request.

### Target branch

`targetBranch` - [text](/data-model/types/text.md) | null

Target branch of the pull request.

### Status

`status` - [PullRequestStatus](/data-model/types/enum/pullrequeststatus.md)

Current status of the pull request (such as Open, Merged, etc.).

### Process stage

`processStage` - [ProcessStage](/data-model/types/enum/processstage.md)

Current stage of the pull request delivery process (such as In progress, Closed, etc.).

### AI tools

`aiTools` - [Array](/data-model/types/array.md)<[text](/data-model/types/text.md)>

AI tools the pull request author(s) used.

### AI assistants

`aiAttributionCategories` - [Array](/data-model/types/array.md)<[text](/data-model/types/text.md)>

AI tools attributed to this pull request (such as ClaudeCode, Cursor, etc.). Has value None when no AI tools were used.

### Cloud agent

`aiCodingAgent` - [text](/data-model/types/text.md) | null

AI cloud agent that authored this pull request.

### Review agents

`reviewAgents` - [Array](/data-model/types/array.md)<[text](/data-model/types/text.md)>

AI review agents that have left review evidence on this pull request.

### Cloud agent commit %

`codingAgentCommitRatio` - [double](/data-model/types/double.md)

Share of commits in this pull request authored by AI cloud agents, between 0 and 1.

### Has been approved

`hasBeenApproved` - [boolean](/data-model/types/boolean.md)

Whether the pull request has at least one approval review.

### Batch size

`linesChanged` - [int](/data-model/types/int.md)

Number of lines changed in the pull request (excluding generated files).

### Additions

`additions` - [int](/data-model/types/int.md)

Number of lines added in the pull request (excluding generated files).

### Deletions

`deletions` - [int](/data-model/types/int.md)

Number of lines deleted in the pull request (excluding generated files).

### Changed files

`changedFiles` - [json](/data-model/types/json.md) | null

Files changed in this pull request with additions, deletions, and change type. The list is truncated for very large pull requests; compare its length with the changed files count to detect truncation.

### Changed implementation files

`changedImplementationFiles` - [json](/data-model/types/json.md) | null

Non-test files changed in this pull request with additions, deletions, and change type. The list is truncated for very large pull requests.

### Changed test files

`changedTestFiles` - [json](/data-model/types/json.md) | null

Test files changed in this pull request with additions, deletions, and change type. The list is truncated for very large pull requests.

### Changed files count

`changedFilesCount` - [int](/data-model/types/int.md) | null

Number of files changed in the pull request (excluding generated files), not truncated. Defined only when the source system provides file-level data.

### Implementation lines changed

`implementationLinesChanged` - [int](/data-model/types/int.md) | null

Lines changed in non-test files (excluding generated files).

### Test lines changed

`testLinesChanged` - [int](/data-model/types/int.md) | null

Lines changed in test files (excluding generated files).

### Implementation additions

`implementationAdditions` - [int](/data-model/types/int.md) | null

Lines added in non-test files (excluding generated files).

### Test additions

`testAdditions` - [int](/data-model/types/int.md) | null

Lines added in test files (excluding generated files).

### Implementation deletions

`implementationDeletions` - [int](/data-model/types/int.md) | null

Lines deleted in non-test files (excluding generated files).

### Test deletions

`testDeletions` - [int](/data-model/types/int.md) | null

Lines deleted in test files (excluding generated files).

### Opened at

`openedAt` - [timestamp](/data-model/types/timestamp.md)

Time the pull request was opened.

### Merged at

`mergedAt` - [timestamp](/data-model/types/timestamp.md) | null

Time the pull request was merged.

### Closed or merged at

`closedOrMergedAt` - [timestamp](/data-model/types/timestamp.md) | null

Time the pull request was closed or merged.

### Source updated at

`updatedAt` - [timestamp](/data-model/types/timestamp.md)

Time when the pull request was last updated in the source system (such as GitHub, GitLab, etc.).

### Last activity at

`lastActivityAt` - [timestamp](/data-model/types/timestamp.md) | null

Timestamp of the most recent activity (comment, review, commit, merge, etc.) on this pull request across GitHub and GitLab sources.

### Cycle time

`totalCycleTime` - [timestampMultirange](/data-model/types/timestampmultirange.md)

Total cycle time of the pull request, including any time spent in draft. For a pull request that is still open, the last period is open-ended and runs to the current time.

### Draft time

`inDraftTime` - [timestampMultirange](/data-model/types/timestampmultirange.md) | null

Time the pull request has spent as a draft, which can span several separate periods. An open-ended final range means it has not been marked ready for review yet or closed in draft state.

### In progress

`inProgressTime` - [timestampMultirange](/data-model/types/timestampmultirange.md)

Time the pull request has been in progress, from the first commit or when it was opened until it was marked ready for review. For a pull request that is still in progress, the range is open-ended and runs to the current time.

### Time to first review

`inWaitingFirstReviewTime` - [timestampMultirange](/data-model/types/timestampmultirange.md) | null

Time the pull request has been waiting for its first review after being considered ready for review. For a pull request that is still waiting for the review, the range is open-ended and runs to the current time. Not defined for pull requests that have not been reviewed.

### Review time

`inReviewTime` - [timestampMultirange](/data-model/types/timestampmultirange.md) | null

Time the pull request has been in review. For a pull request that is still in review, the range is open-ended and runs to the current time. Not defined for pull requests that never entered review.

### Merge time

`inWaitingMergeTime` - [timestampMultirange](/data-model/types/timestampmultirange.md) | null

Time the pull request has been waiting to be merged after it has reached approved state. For a pull request that is still waiting to be merged, the range is open-ended and runs to the current time. Not defined if the pull request was merged without approval.

### Link source

`issueLinkSource` - [IssueLinkSource](/data-model/types/enum/issuelinksource.md) | null

How the pull request got linked to an issue (such as Manual, AI link, etc.).

### Labels

`labels` - [Array](/data-model/types/array.md)<[text](/data-model/types/text.md)>

Labels assigned to this pull request.

### Is draft

`isDraft` - [boolean](/data-model/types/boolean.md)

Whether the pull request is a draft.

### Commit count

`commitCount` - [int](/data-model/types/int.md)

Number of commits in the pull request.

### Is excluded

`isExcluded` - [boolean](/data-model/types/boolean.md)

Whether the pull request is excluded from metrics and reports.

### Exclusion source

`exclusionSource` - [ExclusionSource](/data-model/types/enum/exclusionsource.md) | null

What caused the pull request to be excluded (Auto or Manual).

### AI attribution tags

`aiAttributionTags` - [Array](/data-model/types/array.md)<[text](/data-model/types/text.md)>

AI tool attribution tags combining tool name, usage mode, and confidence (e.g. "Cursor:Editor:High"). Equal to \["None"] when no AI tools were used.

### Last webhook at

`lastWebhookAt` - [timestamp](/data-model/types/timestamp.md) | null

Time of the most recent webhook received for this pull request (not available for GitHub).

## Relations

### Author

`author` - [Author](/data-model/entities/author.md) (1-1)

Author of this pull request.

### Merged by

`mergedByAuthor` - [Author](/data-model/entities/author.md) (1-1)

Person who merged this pull request.

### Owner teams

`ownerTeams` - [Team](/data-model/entities/team.md) (1-N)

Teams owning this pull request.

### Mentioned authors

`mentionedAuthors` - [Author](/data-model/entities/author.md) (1-N)

Authors @mentioned in the pull request description.

### All commit authors

`allCommitAuthors` - [Author](/data-model/entities/author.md) (1-N)

Authors and co-authors of commits in the pull request, including AI coding agents.

### Linked issue

`linkedIssue` - [Issue](/data-model/entities/issue.md) (1-1)

Issue linked to this pull request.

## Aggregates

### Pull requests in progress, avg.

`averageWorkInProgress` - [double](/data-model/types/double.md) | null

Average amount of pull requests in progress over a period of time.

### Pull requests in progress, avg.

`averagePullRequestsInProgress` - [double](/data-model/types/double.md) | null

Average amount of pull requests in progress over a period of time.

{% hint style="info" %}
This page is automatically generated
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.swarmia.com/data-model/entities/pull-request.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
