PullRequests
Pull Requests in a repository.
Table Specific Information
Select
Due to the way that the API filters pull request states, by default, pull requests in all states are requested. To request a single pull request, the pull request Id must be specified in the query, as shown below.
SELECT * FROM PullRequests WHERE Id = 2
The driver uses the Bitbucket API to process WHERE clause conditions built with the below columns. Filtering on other columns is processed client-side within the driver.
- Id
- Title
- State
- CommentCount
- TaskCount
- Reason
- CreatedOn
- UpdatedOn
The driver uses the Bitbucket API to process ORDER BY clause conditions built with the below columns. Sorting on other columns is processed client-side within the driver.
- Id
- Title
- State
- AuthorUUID
- SourceRepositoryUUID
- SourceRepositoryName
- SourceBranchName
- DestinationRepositoryUUID
- DestinationRepositoryName
- DestinationBranchName
- CommentCount
- TaskCount
- ClosedByUUID
- Reason
- CreatedOn
- UpdatedOn
For example, the following query is processed server side:
SELECT * FROM PullRequests WHERE Id=6 AND State='OPEN'
Insert
At minimum, the Title and SourceBranchName fields must be specified to create a new pull request. Optionally, the SummaryRaw, SourceCommitHash, DestinationBranchName, DestinationCommitHash, and CloseSourceBranch fields can also be specified.
If no destination branch is specified, the destination will be the master branch.
A sample INSERT is included below:
INSERT INTO PullRequests (Title, SourceBranchName) VALUES ('newrequest', 'mybranch')
Update
Only open pull requests can be modified.
A sample UPDATE is included below:
UPDATE PullRequests SET Title='NewPR' WHERE Id=4
Delete
DELETEs are not supported for this table.
Columns
Name | Type | ReadOnly | References | Description |
Id [KEY] | Int | False |
The pull request's unique ID. | |
Title | String | False |
Title of the pull request. | |
SummaryRaw | String | False |
The text as it was typed by a user. | |
SummaryMarkup | String | True |
The type of markup language in whivh the raw content will be interpreted. | |
SummaryHTML | String | True |
The user's content rendered as HTML. | |
State | String | True |
The pull request's current status. Valid values: OPEN, MERGED, DECLINED, SUPERSEDED. | |
AuthorUUID | String | True |
UUID of the author of the PR. | |
AuthorName | String | True |
Display Name of the author of the PR. | |
SourceRepositoryUUID | String | True |
The source repository's uuid. | |
SourceRepositoryName | String | True |
The source repository's name. | |
SourceBranchName | String | False |
The source branch's name. | |
SourceCommitHash | String | False |
The source commit's hash. | |
DestinationRepositoryUUID | String | True |
The destination repository's uuid. | |
DestinationRepositoryName | String | True |
The destination repository's name. | |
DestinationBranchName | String | False |
The destination branch's name. | |
DestinationCommitHash | String | False |
The destination commit's hash. | |
MergeCommitHash | String | True |
The merge commit's hash. | |
CommentCount | Int | True |
The number of comments for a specific pull request. | |
TaskCount | Int | True |
The number of open tasks for a specific pull request. | |
CloseSourceBranch | Bool | False |
Whether merging the pull request closes the source branch. | |
ClosedByUUID | String | True |
UUID of the person who closed the PR. | |
ClosedByName | String | True |
Display Name of the person who closed the PR. | |
Reason | String | True |
If the PR is in the rejected state, explains why the pull request was declined. | |
CreatedOn | Datetime | True |
The ISO8601 timestamp when the request was created. | |
UpdatedOn | Datetime | True |
The ISO8601 timestamp when the request was last updated. |