Actions29
Overview
This node enables interaction with the Bitbucket Data Center API, specifically allowing users to create pull requests within a specified project repository. It is useful for automating code review workflows by programmatically opening pull requests from one branch to another. For example, developers can use this node to automatically create pull requests when feature branches are ready to be merged into the main branch, facilitating continuous integration and collaboration.
Properties
| Name | Meaning |
|---|---|
| Authentication | Method of authentication: "Personal Access Token" or "Basic Auth". |
| Project | The key of the Bitbucket project containing the repository where the pull request is created. |
| Repository | The slug of the repository within the selected project (required but not listed in user input; inferred as needed). |
| Title | The title of the pull request. |
| From Branch | The source branch name from which changes will be pulled (e.g., "feature-branch"). |
| To Branch | The destination branch name into which changes will be merged (default is "main"). |
Note: Although the bundled code requires the repository slug (repositorySlug) parameter for pull request operations, it was not explicitly provided in the user properties. This property is required for the operation to succeed.
Output
The output is a JSON array containing the response data from the Bitbucket Data Center API after creating the pull request. This typically includes details such as the pull request ID, title, state, author, source and destination branches, creation date, and other metadata related to the newly created pull request.
No binary data output is produced by this node.
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 on the Bitbucket server to create pull requests in the specified project and repository.
Troubleshooting
- Missing Repository Slug: The pull request creation requires specifying the repository slug within the project. Omitting this will cause errors.
- Authentication Errors: Ensure that the provided Personal Access Token or Basic Auth credentials have sufficient permissions and are correctly configured.
- Invalid Branch Names: The
fromRefandtoRefbranches must exist in the repository; otherwise, the API will return an error. - API Request Failures: Network issues or incorrect server URLs can cause request failures. Verify the Bitbucket server URL and network connectivity.
- Error Messages: The node throws errors prefixed with "Bitbucket Data Center API request failed:" followed by the specific message from the API. Review these messages to identify issues such as permission denied, resource not found, or invalid parameters.