Skip to main content

Check out Port for yourself 

Bitbucket (Self Hosted)

Port's Bitbucket Self Hosted (Server / Data Center) integration allows you to model Bitbucket Server / Bitbucket Data Center resources in your software catalog and ingest data into them. It is referred to as Bitbucket Server in Ocean.

Bitbucket Self Hosted

This documentation covers Port's integration with Bitbucket (Self-Hosted). For information about integrating with Bitbucket Cloud, please refer to the Bitbucket Cloud integration documentation.

Overview

This integration allows you to:

  • Map and organize your desired Bitbucket resources and their metadata in Port (see supported resources below).
  • Watch for Bitbucket object changes (create/update/delete) in real-time, and automatically apply the changes to your software catalog.

Supported Resources

The resources that can be ingested from Bitbucket (Self-Hosted) into Port are listed below.
It is possible to reference any field that appears in the API responses linked below in the mapping configuration.

Setup

GitOps Support

The Bitbucket (Self-Hosted) integration does not support GitOps yet. This capability is planned for a future release and is WIP. If you really need GitOps support, you can use the webhook gitops installation method.

Bitbucket (Self-Hosted) version

When using the Real-Time (self-hosted) or Hosted by Port installation method, you should set the bitbucketIsVersion8Point7OrOlder parameter to true if you are using Bitbucket (Self-Hosted) version 8.7 or older. This is because webhook events are setup differently in Bitbucket (Self-Hosted) 8.8 and above.

Choose one of the following installation methods:

Using this installation option means that the integration will be hosted by Port, with a customizable resync interval to ingest data into Port.

Live event support

This integration supports live events, allowing real-time updates to your software catalog without waiting for the next scheduled sync.

Supported live event triggers

Pull Request:

  • pr:modified
  • pr:opened
  • pr:merged
  • pr:reviewer:updated
  • pr:declined
  • pr:deleted
  • pr:comment:deleted
  • pr:from_ref_updated
  • pr:comment:edited
  • pr:reviewer:unapproved
  • pr:reviewer:needs_work
  • pr:reviewer:approved
  • pr:comment:added

Repository:

  • repo:modified
  • repo:refs_changed

Project:

  • project:modified
Self-hosted installation

Alternatively, you can install the integration using the Real-time (self-hosted) method to update Port in real time using webhooks.

Installation

To install, follow these steps:

  1. Go to the Data sources page of your portal.

  2. Click on the + Data source button in the top-right corner.

  3. Click on the relevant integration in the list.

  4. Under Select your installation method, choose Hosted by Port.

  5. Configure the integration settings and application settings as you wish (see below for details).

Application settings

Every integration hosted by Port has the following customizable application settings, which are configurable after installation:

  • Resync interval: The frequency at which Port will ingest data from the integration. There are various options available, ranging from every 1 hour to once a day.

  • Send raw data examples: A boolean toggle (enabled by default). If enabled, raw data examples will be sent from the integration to Port. These examples are used when testing your mapping configuration, they allow you to run your jq expressions against real data and see the results.

Integration settings

Every integration has its own tool-specific settings, under the Integration settings section.
Each of these settings has an ⓘ icon next to it, which you can hover over to see a description of the setting.

Port secrets

Some integration settings require sensitive pieces of data, such as tokens.
For these settings, Port secrets will be used, ensuring that your sensitive data is encrypted and secure.

When filling in such a setting, its value will be obscured (shown as ••••••••).
For each such setting, Port will automatically create a secret in your organization.

To see all secrets in your organization, follow these steps.

Limitations

  • The maximum time for a full sync to run is based on the configured resync interval. For very large amounts of data where a resync operation is expected to take longer, please use a longer interval.

Port source IP addresses

When using this installation method, Port will make outbound calls to your 3rd-party applications from static IP addresses.
You may need to add these addresses to your allowlist, in order to allow Port to interact with the integrated service:

54.73.167.226  
63.33.143.237
54.76.185.219

Configuration

Port integrations use a YAML mapping block to ingest data from the third-party api into Port.

The mapping makes use of the JQ JSON processor to select, modify, concatenate, transform and perform other operations on existing fields and values from the integration API.

Examples

To view and test the integration's mapping against examples of the third-party API responses, use the jq playground in your data sources page. Find the integration in the list of data sources and click on it to open the playground.

Additional examples of blueprints and the relevant integration configurations:

Project

Project blueprint
{
"identifier": "bitbucketProject",
"description": "A software catalog to represent Bitbucket project",
"title": "Bitbucket Project",
"icon": "BitBucket",
"schema": {
"properties": {
"public": {
"icon": "DefaultProperty",
"title": "Public",
"type": "boolean"
},
"description": {
"title": "Description",
"type": "string",
"icon": "DefaultProperty"
},
"type": {
"icon": "DefaultProperty",
"title": "Type",
"type": "string"
},
"link": {
"title": "Link",
"icon": "DefaultProperty",
"type": "string"
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"relations": {}
}
Integration configuration
createMissingRelatedEntities: true
deleteDependentEntities: true
resources:
- kind: project
selector:
query: "true"
port:
entity:
mappings:
identifier: .key
title: .name
blueprint: '"bitbucketProject"'
properties:
public: .public
type: .type
description: .description
link: .links.self[0].href

Repository

Repository blueprint
{
"identifier": "bitbucketRepository",
"description": "A software catalog to represent Bitbucket repositories",
"title": "Bitbucket Repository",
"icon": "BitBucket",
"schema": {
"properties": {
"forkable": {
"icon": "DefaultProperty",
"title": "Is Forkable",
"type": "boolean"
},
"description": {
"title": "Description",
"type": "string",
"icon": "DefaultProperty"
},
"public": {
"icon": "DefaultProperty",
"title": "Is Public",
"type": "boolean"
},
"state": {
"icon": "DefaultProperty",
"title": "State",
"type": "string"
},
"link": {
"title": "Link",
"icon": "DefaultProperty",
"type": "string"
},
"documentation": {
"icon": "DefaultProperty",
"title": "Documentation",
"type": "string",
"format": "markdown"
},
"swagger_url": {
"title": "Swagger URL",
"type": "string",
"format": "url",
"spec": "async-api",
"icon": "DefaultProperty"
},
"readme": {
"title": "Readme",
"type": "string",
"format": "markdown",
"icon": "DefaultProperty"
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"aggregationProperties": {},
"relations": {
"latestCommitAuthor": {
"title": "Latest Commit By",
"description": "The user that made the most recent commit to the base branch",
"target": "bitbucketUser",
"required": false,
"many": false
},
"project": {
"title": "Project",
"target": "bitbucketProject",
"required": false,
"many": false
}
}
}
Integration configuration
createMissingRelatedEntities: true
deleteDependentEntities: true
resources:
- kind: repository
selector:
query: "true"
port:
entity:
mappings:
identifier: .slug
title: .name
blueprint: '"bitbucketRepository"'
properties:
description: .description
state: .state
forkable: .forkable
public: .public
link: .links.self[0].href
documentation: .__readme
relations:
project: .project.key
latestCommitAuthor: .__latestCommit.author.emailAddress

Pull Request

Pull Request blueprint
{
"identifier": "bitbucketPullRequest",
"description": "A software catalog to represent Bitbucket pull requests",
"title": "Bitbucket Pull Request",
"icon": "BitBucket",
"schema": {
"properties": {
"created_on": {
"title": "Created On",
"type": "string",
"format": "date-time",
"icon": "DefaultProperty"
},
"updated_on": {
"title": "Updated On",
"type": "string",
"format": "date-time",
"icon": "DefaultProperty"
},
"description": {
"title": "Description",
"type": "string",
"icon": "DefaultProperty"
},
"state": {
"icon": "DefaultProperty",
"title": "State",
"type": "string",
"enum": [
"OPEN",
"MERGED",
"DECLINED",
"SUPERSEDED"
],
"enumColors": {
"OPEN": "yellow",
"MERGED": "green",
"DECLINED": "red",
"SUPERSEDED": "purple"
}
},
"owner": {
"title": "Owner",
"type": "string",
"icon": "DefaultProperty"
},
"link": {
"title": "Link",
"icon": "DefaultProperty",
"type": "string"
},
"destination": {
"title": "Destination Branch",
"type": "string",
"icon": "DefaultProperty"
},
"source": {
"title": "Source Branch",
"type": "string",
"icon": "DefaultProperty"
},
"reviewers": {
"items": {
"type": "string"
},
"title": "Reviewers",
"type": "array",
"icon": "DefaultProperty"
},
"merge_commit": {
"title": "Merge Commit",
"type": "string",
"icon": "DefaultProperty"
},
"mergedAt": {
"title": "Merged At",
"type": "string",
"format": "date-time",
"icon": "DefaultProperty"
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"aggregationProperties": {},
"relations": {
"participants": {
"title": "Participants",
"description": "Users that contributed to the PR",
"target": "bitbucketUser",
"required": false,
"many": true
},
"repository": {
"title": "Repository",
"target": "bitbucketRepository",
"required": false,
"many": false
}
}
}
Integration configuration
createMissingRelatedEntities: true
deleteDependentEntities: true
resources:
- kind: pull-request
selector:
query: "true"
port:
entity:
mappings:
identifier: .id | tostring
title: .title
blueprint: '"bitbucketPullRequest"'
properties:
created_on: .createdDate | (tonumber / 1000 | strftime("%Y-%m-%dT%H:%M:%SZ"))
updated_on: .updatedDate | (tonumber / 1000 | strftime("%Y-%m-%dT%H:%M:%SZ"))
merge_commit: .fromRef.latestCommit
state: .state
owner: .author.user.emailAddress
link: .links.self[0].href
destination: .toRef.displayId
source: .fromRef.displayId
mergedAt: .closedDate as $d | if $d == null then null else ($d / 1000 | strftime("%Y-%m-%dT%H:%M:%SZ")) end
reviewers: "[.reviewers[].user.emailAddress]"
relations:
repository: .toRef.repository.slug
participants: "[.participants[].user.emailAddress]"

User

User blueprint
{
"identifier": "bitbucketUser",
"description": "A software catalog to represent Bitbucket users",
"title": "Bitbucket User",
"icon": "BitBucket",
"schema": {
"properties": {
"username": {
"type": "string",
"title": "Username",
"description": "The username of the user"
},
"url": {
"title": "URL",
"description": "The link to the user profile",
"icon": "BitBucket",
"type": "string"
},
"portUser": {
"title": "Port User",
"type": "string",
"icon": "DefaultProperty",
"format": "user"
}
},
"required": [
"username"
]
},
"mirrorProperties": {},
"calculationProperties": {},
"aggregationProperties": {},
"relations": {}
}
Integration configuration
createMissingRelatedEntities: true
deleteDependentEntities: true
resources:
- kind: user
selector:
query: "true"
port:
entity:
mappings:
identifier: .emailAddress
title: .displayName
blueprint: '"bitbucketUser"'
properties:
username: .name
url: .links.self[0].href
portUser: .emailAddress

Let's Test It

This section includes sample response data from Bitbucket Server. In addition, it includes the entity created from the resync event based on the Ocean configuration provided in the previous section.

Payload

Here is an example of the payload structure from Bitbucket Server:

Project response data
{
"key": "PROJ",
"id": 1,
"name": "Project",
"public": false,
"type": "NORMAL",
"links": {
"self": [
{
"href": "http://localhost:7990/projects/PROJ"
}
]
}
}
Repository response data
{
"slug": "repostiroy-3",
"id": 3,
"name": "Repostiroy-3",
"hierarchyId": "0a8dadb07bb606236d8c",
"scmId": "git",
"state": "AVAILABLE",
"statusMessage": "Available",
"forkable": true,
"project": {
"key": "PRO3",
"id": 3,
"name": "Project Three",
"public": false,
"type": "NORMAL",
"links": {
"self": [
{
"href": "http://localhost:7990/projects/PRO3"
}
]
}
},
"public": false,
"archived": false,
"links": {
"clone": [
{
"href": "ssh://git@localhost:7999/pro3/repostiroy-3.git",
"name": "ssh"
},
{
"href": "http://localhost:7990/scm/pro3/repostiroy-3.git",
"name": "http"
}
],
"self": [
{
"href": "http://localhost:7990/projects/PRO3/repos/repostiroy-3/browse"
}
]
},
"__readme": "",
"__latestCommit": {
"id": "965068d1461f119139bb6be582bb22a555a195ba",
"displayId": "965068d1461",
"author": {
"name": "[REDACTED]",
"emailAddress": "admin@gmail.com",
"active": true,
"displayName": "Admin",
"id": 3,
"slug": "[REDACTED]",
"type": "NORMAL",
"links": {
"self": [
{
"href": "http://localhost:7990/users/[REDACTED]"
}
]
}
},
"authorTimestamp": 1747744649000,
"committer": {
"name": "[REDACTED]",
"emailAddress": "admin@gmail.com",
"active": true,
"displayName": "Admin",
"id": 3,
"slug": "[REDACTED]",
"type": "NORMAL",
"links": {
"self": [
{
"href": "http://localhost:7990/users/[REDACTED]"
}
]
}
},
"committerTimestamp": 1747744649000,
"message": "Pull request #1: readme.md edited online with Bitbucket\n\nMerge in PRO3/repostiroy-3 from main to master\n\n* commit '3e4df0573a0ba1845ebdfa919c907745497313aa':\n readme.md edited online with Bitbucket",
"parents": [
{
"id": "9534663d88977c0aa5c25249986eae851fd83a8d",
"displayId": "9534663d889"
},
{
"id": "3e4df0573a0ba1845ebdfa919c907745497313aa",
"displayId": "3e4df0573a0"
}
]
}
}
Pull Request response data
{
"id": 1,
"version": 1,
"title": "readme.md edited online with Bitbucket",
"state": "OPEN",
"open": true,
"closed": false,
"draft": false,
"createdDate": 1747730324792,
"updatedDate": 1747730324792,
"fromRef": {
"id": "refs/heads/main",
"displayId": "main",
"latestCommit": "3e4df0573a0ba1845ebdfa919c907745497313aa",
"type": "BRANCH",
"repository": {
"slug": "repostiroy-3",
"id": 3,
"name": "Repostiroy 3",
"hierarchyId": "0a8dadb07bb606236d8c",
"scmId": "git",
"state": "AVAILABLE",
"statusMessage": "Available",
"forkable": true,
"project": {
"key": "PRO3",
"id": 3,
"name": "Project Three",
"public": false,
"type": "NORMAL",
"links": {
"self": [
{
"href": "http://localhost:7990/projects/PRO3"
}
]
}
},
"public": false,
"archived": false,
"links": {
"clone": [
{
"href": "ssh://git@localhost:7999/pro3/repostiroy-3.git",
"name": "ssh"
},
{
"href": "http://localhost:7990/scm/pro3/repostiroy-3.git",
"name": "http"
}
],
"self": [
{
"href": "http://localhost:7990/projects/PRO3/repos/repostiroy-3/browse"
}
]
}
}
},
"toRef": {
"id": "refs/heads/master",
"displayId": "master",
"latestCommit": "9534663d88977c0aa5c25249986eae851fd83a8d",
"type": "BRANCH",
"repository": {
"slug": "repostiroy-3",
"id": 3,
"name": "Repostiroy 3",
"hierarchyId": "0a8dadb07bb606236d8c",
"scmId": "git",
"state": "AVAILABLE",
"statusMessage": "Available",
"forkable": true,
"project": {
"key": "PRO3",
"id": 3,
"name": "Project Three",
"public": false,
"type": "NORMAL",
"links": {
"self": [
{
"href": "http://localhost:7990/projects/PRO3"
}
]
}
},
"public": false,
"archived": false,
"links": {
"clone": [
{
"href": "ssh://git@localhost:7999/pro3/repostiroy-3.git",
"name": "ssh"
},
{
"href": "http://localhost:7990/scm/pro3/repostiroy-3.git",
"name": "http"
}
],
"self": [
{
"href": "http://localhost:7990/projects/PRO3/repos/repostiroy-3/browse"
}
]
}
}
},
"locked": false,
"author": {
"user": {
"name": "[REDACTED]",
"emailAddress": "admin@gmail.com",
"active": true,
"displayName": "Admin",
"id": 3,
"slug": "[REDACTED]",
"type": "NORMAL",
"links": {
"self": [
{
"href": "http://localhost:7990/users/[REDACTED]"
}
]
}
},
"role": "AUTHOR",
"approved": false,
"status": "UNAPPROVED"
},
"reviewers": [],
"participants": [],
"properties": {
"mergeResult": {
"outcome": "CLEAN",
"current": false
},
"resolvedTaskCount": 0,
"commentCount": 0,
"openTaskCount": 0
},
"links": {
"self": [
{
"href": "http://localhost:7990/projects/PRO3/repos/repostiroy-3/pull-requests/1"
}
]
}
}
User response data
{
"name": "[REDACTED]",
"emailAddress": "admin@gmail.com",
"active": true,
"displayName": "Admin",
"id": 3,
"slug": "[REDACTED]",
"type": "NORMAL",
"links": {
"self": [
{
"href": "http://localhost:7990/users/[REDACTED]"
}
]
}
}

Mapping Result

The combination of the sample payload and the Ocean configuration generates the following Port entity:

Project entity in Port
{
"blueprint": "bitbucketProject",
"identifier": "PROJ",
"createdAt": "2025-05-20T09:14:22.361Z",
"updatedBy": "jqoQ34Azuy08BJFFUZAKyP3sXranvmgc",
"createdBy": "jqoQ34Azuy08BJFFUZAKyP3sXranvmgc",
"team": [],
"title": "Project",
"relations": {},
"properties": {
"public": false,
"link": "http://localhost:7990/projects/PROJ",
"description": null,
"type": "NORMAL"
},
"updatedAt": "2025-05-22T20:46:27.616Z"
}
Repository entity in Port
{
"blueprint": "bitbucketRepository",
"identifier": "repostiroy-3",
"createdAt": "2025-05-20T13:14:09.505Z",
"updatedBy": "jqoQ34Azuy08BJFFUZAKyP3sXranvmgc",
"createdBy": "jqoQ34Azuy08BJFFUZAKyP3sXranvmgc",
"team": [],
"title": "Repostiroy-3",
"relations": {
"project": "PRO3",
"latestCommitAuthor": "admin@gmail.com"
},
"properties": {
"public": false,
"documentation": "",
"link": "http://localhost:7990/projects/PRO3/repos/repostiroy-3/browse",
"forkable": true,
"description": null,
"state": "AVAILABLE",
"readme": null,
"swagger_url": null
},
"updatedAt": "2025-05-20T13:14:09.505Z"
}
Pull Request entity in Port
{
"blueprint": "bitbucketPullRequest",
"identifier": "1",
"createdAt": "2025-05-20T09:22:29.565Z",
"updatedBy": "jqoQ34Azuy08BJFFUZAKyP3sXranvmgc",
"createdBy": "jqoQ34Azuy08BJFFUZAKyP3sXranvmgc",
"team": [],
"title": "readme.md edited online with Bitbucket",
"relations": {
"repository": "repostiroy-3",
"participants": []
},
"properties": {
"updated_on": "2025-05-20T12:37:29Z",
"owner": "admin@gmail.com",
"created_on": "2025-05-20T08:38:44Z",
"mergedAt": "2025-05-20T12:37:29Z",
"link": "http://localhost:7990/projects/PRO3/repos/repostiroy-3/pull-requests/1",
"destination": "master",
"description": null,
"state": "MERGED",
"source": "main",
"reviewers": [],
"merge_commit": "3e4df0573a0ba1845ebdfa919c907745497313aa"
},
"updatedAt": "2025-05-20T12:37:34.111Z"
}
User entity in Port
{
"blueprint": "bitbucketUser",
"identifier": "admin@gmail.com",
"createdAt": "2025-05-20T09:10:04.195Z",
"updatedBy": "jqoQ34Azuy08BJFFUZAKyP3sXranvmgc",
"createdBy": "jqoQ34Azuy08BJFFUZAKyP3sXranvmgc",
"team": [],
"title": "Admin",
"relations": {},
"properties": {
"portUser": "admin@gmail.com",
"url": "http://localhost:7990/users/admin",
"username": "admin"
},
"updatedAt": "2025-05-20T09:10:04.195Z"
}

Alternative Installation Via Webhooks

While the Ocean integration described above is the recommended installation method, you may prefer to use a webhook to ingest data from Jira. If so, you can follow the instructions in the webhook section.