Bitbucket Data Center
Receive Bitbucket Data Center pull request events in Plural
A Bitbucket Data Center webhook delivers pull requests and pull request comments from Bitbucket Data Center into Plural. Each pull request or comment becomes an issue record in Plural that a workbench can act on. You can register the webhook on a project, where every repository inherits it, or on a single repository.
An event does not start a job by itself. A job starts only when a webhook trigger on a workbench matches the item, and only when the item has just become open, such as a newly opened pull request or a new comment on an open one. Edits to an item that is already open do not start another job, and the same item starts at most one job per workbench in an hour.
This webhook is separate from the SCM webhook Plural uses for pull request automation and Flows. See SCM webhooks and PR linking for that one.
What Plural reads from the payload
Plural looks at the shape of the payload, not the eventKey. Any event that carries a pullRequest object is recorded. Repository events, such as pushes and commit comments, are acknowledged and ignored.
Bitbucket event | Recorded as | Title | Body | Link |
|---|---|---|---|---|
| Pull request opened, modified, merged, declined, and other pull request events | The pull request | Pull request title | Description | The pull request's links.self URL |
| Pull request comment added, edited, or deleted | A separate item per comment | Comment on PR: <title> (#<comment id>) | Comment text | Pull request URL with #comment-<id> |
Plural identifies each item by project key, repository slug (taken from the pull request's toRef), and pull request or comment ID, so later events for the same pull request or comment update the existing record instead of creating a new one. An empty body is stored as {empty}, and bodies longer than 10,000 characters are truncated.
A trigger matches against the title and body joined by a newline. Because a comment's title includes the pull request title, a trigger that matches text in a pull request title also matches every comment on that pull request.
Status
Item | Open | Completed | Cancelled |
|---|---|---|---|
| Pull request | OPEN and any other state | MERGED | DECLINED, SUPERSEDED |
| Comment | Follows its pull request |