This plugin requires a Jenkins v2.138.2 or later and supports the Bitbucket rest api v2.x+ and later.
The new features introduced by the Bitbucket Push and Pull Request plugin are:
If you are using a Jenkins v2.138.2 or later, you may have some problems with the older Bitbucket plugin. This uses the JSONObject, already blacklisted by the JEP-200, causing an exception UnsupportedOperationException: Refusing to marshal net.sf.json.JSONObject for security reasons
In case you are using Bitbucket Cloud, configure your Bitbucket repository adding a webhook in the settings page. In the URL field (see image, point A) add your JENKINS_URL followed by "/bitbucket-hook/" (for example "https://my-jenkins.on-my-planet-far-away.com/bitbucket-hook/") Credentials for the webhook endpoint are not required, the trailing slash is mandatory. For more infos please consult the resource https://confluence.atlassian.com/bitbucket/manage-webhooks-735643732.html.
If you are using Bitbucket Server, follow the following steps: