At the moment I'm using the BitBucket Build Pull Request plugin successfully. I want to tell BitBucket to accept and merge the PR (or merge the PR and push to BitBucket) on Jenkins success.
This answer
How do I push changes from one branch to another branch after a successful Jenkins build?
looks like it's on the right track, but it's old and isn't built with Jenkins 2 pipelines.
How would I achieve the same result with Jenkins 2?