turbot/bitbucket

steampipe plugin install bitbucketsteampipe plugin install bitbucket

Table: bitbucket_pull_request

Bitbucket pull requests let you tell others about changes you've pushed to a branch in a repository. Once a pull request is opened, you can discuss and review the potential changes with collaborators and add follow-up commits before your changes are merged into the base branch.

The bitbucket_pull_request table can be used to query pull requests belonging to a repository. You must specify which repository in a where or join clause (where repository_full_name=', join bitbucket_pull_request on repository_full_name=).

Examples

List open pull requests in a repository

select
repository_full_name,
id,
title,
state,
branch_name,
author_display_name
from
bitbucket_pull_request
where
repository_full_name = 'bitbucketpipelines/official-pipes'
and state = 'OPEN';

List the pull requests for a repository that have been merged in the last week

select
repository_full_name,
id,
title,
state,
updated as merged_at,
closed_by_display_name as merged_by_name,
closed_by_uuid as merged_by_uuid
from
bitbucket_pull_request
where
repository_full_name = 'bitbucketpipelines/official-pipes'
and state = 'MERGED'
and updated >= (current_date - interval '7' day)
order by
updated desc;

List the open PRs in a repository assigned to a specific user

select
repository_full_name,
id,
title,
state,
author_display_name,
author_uuid
from
bitbucket_pull_request
where
repository_full_name = 'bitbucketpipelines/official-pipes'
and author_display_name = 'Tom Gibson'
and state = 'OPEN';

.inspect bitbucket_pull_request

Issues are used to track ideas, enhancements, tasks, or bugs for work on Bitbucket.

NameTypeDescription
author_display_nametextDisplay name of the author of this pull request.
author_uuidtextUUID of the author of this pull request.
branch_nametextName of the source branch for the pull request.
close_source_branchbooleanA boolean flag indicating if merging the pull request closes the source branch.
closed_by_display_nametextDisplay name of the user who closed this pull request.
closed_by_uuidtextUUID of the user who closed of this pull request.
comment_countbigintThe number of comments for a specific pull request.
createdtimestamp without time zoneTimestamp when pull request was created.
descriptiontextDescription of the pull request.
editedtimestamp without time zoneTimestamp when pull request was last edited.
idbigintThe pull request's unique ID. Note that pull request IDs are only unique within their associated repository.
merge_committextMerge commit hash details for pull request.
participantsjsonbList of collaborators on the pull request.
repository_full_nametextThe repository's full name.
reviewersjsonbList of reviewers of the pull request.
self_linktextA self link to this pull request.
statetextA current state of the pull request. Can be one of "MERGED", "SUPERSEDED", "OPEN" and "DECLINED".
summarytextSummary details of the pull request.
task_countbigintThe number of open tasks for a specific pull request.
titletextTitle of the resource.
typetextType of the Bitbucket resource. It will be always "pullrequest".
updatedtimestamp without time zoneTimestamp when pull request was last updated.