Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
3873686
Add repoFilter tab to Bitbucket Cloud advanced documentation
dennis-bilson-port Nov 21, 2025
0db5190
Refine Bitbucket Cloud advanced docs for `repoFilter` usage and param…
dennis-bilson-port Nov 21, 2025
e4e311f
Expand Bitbucket Cloud advanced docs with `repoFilter` role and query…
dennis-bilson-port Nov 21, 2025
2209419
Fix typo in Bitbucket Cloud advanced docs for `repoFilter` parameter …
dennis-bilson-port Nov 21, 2025
c516014
Merge branch 'main' into PORT-16836-Docs-Add-Selector-Filters-To-Inte…
dennis-bilson-port Nov 26, 2025
2d210b7
Merge branch 'main' into PORT-16836-Docs-Add-Selector-Filters-To-Inte…
dennis-bilson-port Dec 1, 2025
2afa86e
Merge branch 'main' into PORT-16836-Docs-Add-Selector-Filters-To-Inte…
dennis-bilson-port Dec 8, 2025
34a1ffa
docs: Rename `repoFilter` parameter `q` to `query` in Bitbucket Cloud…
dennis-bilson-port Dec 8, 2025
59a9b22
Merge branch 'main' into PORT-16836-Docs-Add-Selector-Filters-To-Inte…
dennis-bilson-port Dec 9, 2025
3b1268d
Merge branch 'main' into PORT-16836-Docs-Add-Selector-Filters-To-Inte…
dennis-bilson Dec 10, 2025
412d0e1
Update examples.md
dennis-bilson-port Dec 10, 2025
1331ba5
Update examples.md
dennis-bilson-port Dec 10, 2025
3e6e179
Merge branch 'main' into PORT-16836-Docs-Add-Selector-Filters-To-Inte…
dennis-bilson-port Dec 16, 2025
6309dd5
Merge branch 'main' into PORT-16836-Docs-Add-Selector-Filters-To-Inte…
dennis-bilson-port Dec 18, 2025
d3e626a
Merge branch 'main' into PORT-16836-Docs-Add-Selector-Filters-To-Inte…
dennis-bilson-port Dec 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,32 @@ The `createMissingRelatedEntities` parameter is used to enable the creation of m

</TabItem>

<TabItem value="repoFilter" label="Filter repositories">

Use the `repoFilter` parameter is to [narrow down data fetched](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-repositories-workspace-get) for repositories with a specific set of query parameters.

- **Default value**: `None` to fetch all repositories.
- **Use case**: set this in your configuration if you want to opt into this behavior.
- **role**: Specify with one of the following values: `member`, `contributor`, `admin`, `owner`.

```yaml showLineNumbers
repoFilter:
# highlight-next-line
role: "admin"
resources:
# remaining resource definitions omitted for brevity
```
- **query**: Specify as a search query string to filter repositories.

```yaml showLineNumbers
repoFilter:
# highlight-next-line
query: 'parent.owner.nickname = ""'
resources:
# remaining resource definitions omitted for brevity
```

</TabItem>

</Tabs>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
sidebar_position: 2
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import MicroserviceBlueprint from './\_bitbucket_integration_example_repository_blueprint.mdx'
import PRBlueprint from './\_bitbucket_integration_example_pull_request_blueprint.mdx'
import PortAppConfig from './\_bitbucket_integration_example_port_app_config.mdx'
Expand All @@ -25,13 +26,77 @@ The following example demonstrates how to ingest your Bitbucket projects, reposi

<PortAppConfig/>

### Repository configuration options

<Tabs groupId="config" queryString="parameter">

<TabItem label="User Role" value="userRole">

The `userRole` selector allows you to filter repositories based on the user role. You can specify only one user role to include in the sync.

Allowed values:
- `owner`: Repositories owned by the current user.
- `member`: Repositories to which the user has explicit read access.
- `admin`: Repositories to which the user has explicit administrator access.
- `contributor`: Repositories to which the user has explicit write access.

By default, if not specified, no user role filter will be applied.

```yaml
- kind: repository
selector:
query: 'true'
# highlight-next-line
userRole: owner
```

</TabItem>

<TabItem label="Repository Query" value="repoQuery">

The `repoQuery` selector allows you to filter repositories based on a custom query. You can specify a custom query to include in the sync.

```yaml
- kind: repository
selector:
query: 'true'
# highlight-next-line
repoQuery: 'language="python"'
```

</TabItem>

</Tabs>

### Pull request configuration options

The `pullRequestQuery` selector allows you to filter pull requests based on a custom query. You can specify a custom query per the official BitBucket filtering and sorting specifications to include in the sync.

By default, if not specified, all open pull requests will be ingested.

```yaml
- kind: pull-request
selector:
query: 'true'
# highlight-next-line
pullRequestQuery: 'state="OPEN" OR (state="MERGED" AND updated_on > "2025-12-10T14:00:00-07:00")'
```

:::warning Performance impact
Non-open pull requests (such as `MERGED` or `DECLINED`) can accumulate to an extremely large volume over time, which may significantly increase the time required to complete a resync for the integration.

To prevent performance degradation, if you intend to ingest non-open pull requests, you must add a filtering criteria such as `updated_on` to limit the number of items ingested.
The example above demonstrates this by retrieving all `OPEN` pull requests, while limiting `MERGED` pull requests to those updated after a specific timestamp.
:::

:::tip

- Refer to the [installation](installation.md) guide to learn more about the `port-app-config.yml` installation process;
- We leverage [JQ JSON processor](https://stedolan.github.io/jq/manual/) to map and transform Bitbucket objects to Port Entities;
- Click [Here](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-workspaces/#api-workspaces-workspace-projects-get) for the Bitbucket project object structure.
- Click [Here](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-repositories-workspace-repo-slug-get) for the Bitbucket repository object structure.
- Click [Here](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-get) for the Bitbucket pull request object structure.
- Click [Here](https://developer.atlassian.com/cloud/bitbucket/rest/intro/#filtering) for the Bitbucket filtering and sorting API.
:::

After creating the blueprints and updating the mapping, you will see new entities in Port matching your repositories alongside their README.md file contents and pull requests.
Expand Down