bitbucket-pr-management
Bitbucket PR Management
Host Boundaries
Use these instructions for Bitbucket Cloud PR URLs such as https://bitbucket.org/<workspace>/<repo_slug>/pull-requests/<id>.
For self-hosted Bitbucket Server or Data Center, never reuse Bitbucket Cloud API routes or the Cloud helper. Establish the route and authentication from official API documentation that matches the instance and version, or from an approved local integration. If neither is available, report the parsed PR identity and the missing evidence; do not invent a universal self-hosted route.
Authentication
Prefer existing approved credentials before asking how to authenticate. Never print, paste, commit, store, place credentials in URLs, or put secrets in command history.
Use only one of these supported Bitbucket Cloud REST authentication shapes per attempt:
- Set
BITBUCKET_TOKENonly for an explicitly approved OAuth 2 access token. - Set
BITBUCKET_EMAILto the Atlassian account email andBITBUCKET_API_TOKENto the API token bound to that account. This is API-token Basic authentication.
Do not reuse a generic bitbucket.org Git credential for REST. Git API-token authentication accepts a Bitbucket username or the static x-bitbucket-api-token-auth username, while REST API-token Basic authentication requires the Atlassian account email. If only Git credentials are available, request or locate a separately approved REST credential whose email-token binding is known; never infer the email from a Git username.