NOTICE: All information contained herein is, and remains
the property of TechnoCore Automate.
Updated : 2026-04-20
ObjServiceBitbucket provides a reusable Bitbucket Cloud REST API v2.0
integration for the Axion platform. It wraps repository, pull-request,
pipeline, commit, and issue endpoints with HTTP Basic authentication,
automatic pagination, rate-limit handling (429 retry), and error logging.
A shared def_integration_sync table tracks bidirectional mappings between
Axion records and Bitbucket external IDs, enabling sync workflows across
multiple providers.
| Area | Methods |
|---|---|
| Repository | get_repo(), list_branches(), get_branch() |
| Pull Requests | list_pull_requests(), get_pull_request(), create_pull_request(), add_pr_comment(), approve_pr(), merge_pr() |
| Pipelines | list_pipelines(), get_pipeline(), trigger_pipeline() |
| Commits | list_commits(), get_commit() |
| Issues | list_issues(), create_issue() |
| Sync | link_record(), get_external_id(), get_local_key() |
Rate limit: Bitbucket Cloud applies per-user rate limits. On HTTP 429 the
service sleeps for the Retry-After header value (default 60 s) and retries
up to 3 times.
Pagination: Bitbucket uses ?page= with a next URL in paginated
responses. The _paginate() helper follows next links up to a
configurable max_pages (default 10).
base:
bitbucket:
username: $environment_BITBUCKET_USERNAME$
app_password: $environment_BITBUCKET_APP_PASSWORD$
workspace: technocore_axion
repo: axion
Credentials should be set via environment variables so they are never
stored in source control.
export AXION_BITBUCKET_USERNAME="your-username"
export AXION_BITBUCKET_APP_PASSWORD="your-app-password"
The def_integration_sync table maps local records to external objects
across multiple providers (bitbucket, asana, etc.):
| Column | Description |
|---|---|
| Guid | Primary key (auto-generated) |
| Package | Active Axion package |
| Provider | Integration provider (bitbucket) |
| SourceTable | Local table name |
| SourceKey | Local record key |
| ExternalId | External object identifier |
| ExternalType | pullrequest, branch, pipeline, commit, issue |
| SyncStatus | synced, error, deleted |
| SyncedAt | Last sync timestamp |
# Verify credentials and show connected repository
python ObjServiceBitbucket.py test-connection
# List open pull requests
python ObjServiceBitbucket.py list-prs
# List pull requests by state
python ObjServiceBitbucket.py list-prs --state MERGED
# List recent pipelines
python ObjServiceBitbucket.py list-pipelines
# List repository branches
python ObjServiceBitbucket.py list-branches
from ObjServiceBitbucket import ObjServiceApi
svc = ObjServiceApi()
# List open pull requests
for pr in svc.list_pull_requests():
print(f"#{pr['id']} {pr['title']}")
# Create a pull request
pr = svc.create_pull_request(
"Add user export feature",
"feat/user-export",
dest_branch="develop",
description="Adds CSV export for user data",
)
if pr.get("id"):
svc.link_record(
"def_features", "FEAT-42",
str(pr["id"]), "pullrequest",
)
# Trigger a pipeline
svc.trigger_pipeline(
"develop",
variables={"DEPLOY_ENV": "staging"},
)
Updated : 2026-04-20