Bitbucket Data Center icon

Bitbucket Data Center

Interact with Bitbucket Data Center API

Overview

This node interacts with the Bitbucket Data Center API to manage pull requests among other resources. Specifically, the "Needs Work" operation marks a specified pull request as requiring further changes before it can be approved or merged. This is useful in code review workflows where reviewers want to signal that the current state of the pull request is not ready for merging and needs additional work from the author.

Typical use cases include:

  • Automating pull request status updates based on CI/CD pipeline results.
  • Integrating with external tools to programmatically mark pull requests as needing work.
  • Streamlining team collaboration by clearly indicating pull requests that require more attention.

Example: After running automated tests, if some tests fail, this node can mark the related pull request as "Needs Work" to notify developers.

Properties

Name Meaning
Authentication Method used to authenticate with Bitbucket Data Center API. Options: Personal Access Token, Basic Auth
Project The key of the project containing the repository and pull request to operate on
Pull Request ID The numeric ID of the pull request to mark as needing work

Output

The output JSON contains the response from the Bitbucket Data Center API after marking the pull request as needing work. Typically, this includes details about the updated pull request participant status reflecting the "NEEDS_WORK" state.

If the operation succeeds, the output will be an object representing the updated participant information for the pull request, including user info and approval status.

No binary data is output by this operation.

Dependencies

  • Requires access to a Bitbucket Data Center instance.
  • Requires either a personal access token or basic authentication credentials configured in n8n.
  • The node uses the Bitbucket Data Center REST API endpoints under /rest/api/1.0.
  • Proper permissions are needed to update pull request participants and statuses.

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 to modify pull request participants may cause authorization errors.
  • Error messages:

    • Bitbucket Data Center API request failed: ... indicates an issue with the API call; check credentials and parameters.
    • The operation "needsWork" is not supported for resource "pullRequest" would indicate a misconfiguration but should not occur here since "needsWork" is supported.
    • Network connectivity issues or incorrect server URL configuration can also cause failures.
  • Resolution tips:

    • Verify that the project key, repository slug, and pull request ID are correct.
    • Ensure the API credentials have sufficient rights to update pull requests.
    • Check the Bitbucket Data Center server URL and network accessibility.
    • Enable "Continue On Fail" in the node settings to handle errors gracefully during batch executions.

Links and References

Discussion