Bitbucket Data Center icon

Bitbucket Data Center

Interact with Bitbucket Data Center API

Actions29

Overview

This node interacts with the Bitbucket Data Center API to manage branches within repositories of a specified project. Specifically, the "Branch - Get All" operation retrieves a list of all branches in a given repository under a selected project.

Common scenarios where this node is beneficial include:

  • Automating branch management workflows by fetching branch lists for reporting or further processing.
  • Integrating branch data into CI/CD pipelines or dashboards.
  • Auditing or monitoring repository branches programmatically.

For example, you could use this node to fetch all branches of a repository before triggering automated tests on each branch or to generate a report of active branches in a project.

Properties

Name Meaning
Authentication Method used to authenticate API requests. Options: Personal Access Token, Basic Auth.
Project The key of the project containing the repository. This is required to scope the request.
Return All Whether to return all branches or limit the number of results.
Limit Maximum number of branches to return if not returning all (1 to 500).

Output

The output is a JSON array where each item represents a branch object retrieved from the Bitbucket Data Center API. Each branch object typically contains details such as branch name, latest commit information, and metadata related to the branch.

No binary data is output by this operation.

Example output snippet (simplified):

[
  {
    "id": "refs/heads/main",
    "displayId": "main",
    "latestCommit": "abc123def456...",
    "isDefault": true
  },
  {
    "id": "refs/heads/feature-branch",
    "displayId": "feature-branch",
    "latestCommit": "789xyz654uvw...",
    "isDefault": false
  }
]

Dependencies

  • Requires access to a Bitbucket Data Center instance.
  • Requires authentication via either a personal access token or basic authentication credentials.
  • The node depends on n8n's credential system to securely store and use these credentials.
  • The Bitbucket server URL must be configured in the credentials.

Troubleshooting

  • Authentication errors: Ensure that the provided personal access token or basic auth credentials are valid and have sufficient permissions to read branches in the target project and repository.
  • Project or repository not found: Verify that the project key and repository slug are correct and accessible by the authenticated user.
  • Limit exceeded: The API limits the maximum number of items returned per request; if you do not select "Return All," ensure the limit is between 1 and 500.
  • API request failures: Network issues or incorrect server URLs can cause request failures. Check connectivity and server configuration.
  • Empty results: If no branches are returned, confirm that the repository actually contains branches and that the project and repository parameters are correctly set.

Error messages thrown by the node will generally indicate the nature of the failure, e.g., "Bitbucket Data Center API request failed: [error message]". Review the error message for clues and verify your input parameters and credentials accordingly.

Links and References

Discussion