Bitbucket Data Center icon

Bitbucket Data Center

Interact with Bitbucket Data Center API

Overview

This node integrates with Bitbucket Data Center to perform operations on pull requests within a specified project and repository. Specifically, the "Merge" operation allows users to merge a pull request programmatically.

Typical use cases include automating code review workflows, integrating CI/CD pipelines, or managing pull requests as part of a larger DevOps process. For example, after automated tests pass, this node can be used to merge a pull request automatically, streamlining the development lifecycle.

Properties

Name Meaning
Authentication Method of authentication: either "Personal Access Token" or "Basic Auth".
Project The key of the Bitbucket project containing the repository.
Repository The slug (identifier) of the repository within the project.
Pull Request ID The numeric ID of the pull request to merge.

Output

The output is a JSON object representing the result of the merge operation. It typically includes details about the merged pull request such as its status, version, and metadata returned by the Bitbucket API.

If the merge is successful, the output confirms the merge; if not, it may contain error information.

No binary data output is produced by this operation.

Dependencies

  • Requires access to a Bitbucket Data Center instance.
  • Requires credentials for authentication, either a personal access token or basic authentication credentials.
  • The node uses Bitbucket's REST API endpoints under /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/merge.
  • Proper permissions are needed in Bitbucket to merge pull requests.

Troubleshooting

  • Common Issues:

    • Invalid or insufficient permissions for the provided credentials can cause authorization errors.
    • Incorrect project key, repository slug, or pull request ID will result in "not found" errors.
    • Attempting to merge a pull request that has conflicts or is not mergeable will fail.
  • Error Messages:

    • "Bitbucket Data Center API request failed: ..." indicates an issue with the API call, possibly due to network issues, invalid credentials, or incorrect parameters.
    • "The operation "merge" is not supported for resource "pullRequest" would indicate a misconfiguration but should not occur here since "merge" is supported.
  • Resolution Tips:

    • Verify that the project key, repository slug, and pull request ID are correct.
    • Ensure the credentials have merge permissions.
    • Check the pull request status in Bitbucket to confirm it is mergeable.
    • Enable "Continue On Fail" in n8n to handle errors gracefully during workflow execution.

Links and References

Discussion