Bitbucket Data Center icon

Bitbucket Data Center

Interact with Bitbucket Data Center API

Overview

The node interacts with the Bitbucket Data Center API to manage pull requests among other resources. Specifically, the "Decline" operation for the "Pull Request" resource allows users to decline (reject) a pull request in a specified repository within a project. This is useful in scenarios where a proposed code change should not be merged, such as when it does not meet quality standards or conflicts with the main branch.

Practical examples:

  • Automatically declining pull requests that fail certain automated tests.
  • Declining outdated or superseded pull requests via workflow automation.
  • Managing pull request lifecycle programmatically in CI/CD pipelines.

Properties

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

Output

The output JSON structure corresponds to the response from the Bitbucket Data Center API after attempting to decline the pull request. It typically includes details about the updated pull request status and metadata.

If the decline operation succeeds, the output will contain the pull request object reflecting its new declined state.

If the operation fails, an error message will be returned in the output.

No binary data output is involved in this operation.

Dependencies

  • Requires access to a Bitbucket Data Center instance with appropriate API permissions.
  • 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/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/decline.

Troubleshooting

  • Common issues:

    • Invalid or missing project key, repository slug, or pull request ID will cause errors.
    • Insufficient permissions or invalid credentials will result in authentication failures.
    • Attempting to decline a pull request that is already merged or closed may cause API errors.
  • Error messages:

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

    • Verify all required input properties are correctly set.
    • Ensure the API credentials have permission to modify pull requests.
    • Confirm the pull request ID exists and is in a state that can be declined.

Links and References


This summary focuses on the "Decline" operation of the "Pull Request" resource as requested, based on static analysis of the provided source code and property definitions.

Discussion