Bitbucket Data Center icon

Bitbucket Data Center

Interact with Bitbucket Data Center API

Overview

The node integrates with Bitbucket Data Center API to perform various operations on Bitbucket resources. Specifically, the Pull Request - Approve operation allows users to programmatically approve a pull request in a specified repository within a project.

This is useful in automated workflows where pull requests need to be approved as part of CI/CD pipelines, code review automation, or integration with other tools that trigger approvals based on external events.

Example use cases:

  • Automatically approve a pull request after successful automated tests.
  • Approve pull requests created by bots or integrations once certain conditions are met.
  • Integrate approval steps into complex deployment workflows.

Properties

Name Meaning
Authentication Method of authentication to Bitbucket Data Center API:
- Personal Access Token
- Basic Auth
Project The key of the Bitbucket project containing the repository and pull request
Pull Request ID The numeric ID of the pull request to approve

Output

The output JSON contains the response from the Bitbucket Data Center API for the approve action on the pull request participant endpoint. It typically includes details about the participant (the user who approved) and their approval status.

The structure generally looks like this (simplified example):

{
  "user": {
    "name": "username",
    "displayName": "User Full Name",
    ...
  },
  "approved": true,
  "status": "APPROVED"
}

No binary data output is involved in this operation.

Dependencies

  • Requires access to a Bitbucket Data Center instance with API enabled.
  • Requires either a Personal Access Token or Basic Authentication credentials configured in n8n.
  • The node uses the Bitbucket REST API endpoint for pull request participants to set approval status.

Troubleshooting

  • Common issues:

    • Invalid or missing authentication credentials will cause API request failures.
    • Incorrect project key, repository slug, or pull request ID will result in "not found" errors.
    • Insufficient permissions for the authenticated user to approve pull requests.
  • Error messages:

    • Bitbucket Data Center API request failed: ... indicates an issue with the API call; check credentials and parameters.
    • The operation "approve" is not supported for resource "pullRequest" would indicate a misconfiguration or unsupported operation (unlikely here since approve is supported).
  • Resolution tips:

    • Verify that the API credentials have permission to approve pull requests.
    • Confirm the project key, repository slug, and pull request ID are correct.
    • Ensure the Bitbucket server URL is correctly configured in the credentials.
    • Check network connectivity to the Bitbucket Data Center instance.

Links and References

Discussion