Similar question has been answered already: bitbucket-build-status-notifier plugin for jenkins reports wrong status. Indeed, setting "Only show latest build status" checkbox in job's settings solves the issue:
I'm looking for the same ability but via Jenkins Pipeline (since a job configured as a pipeline doesn't have the checkbox mentioned above).
Is it possible to set "Only show latest build status" option via Jenkinsfile for the whole job?
Or may be it's possible to set the option for each notification? I've tried like this but it doesn't work:
...
post {
success {
bitbucketStatusNotify(
buildState: 'SUCCESSFUL',
onlyShowLatestBuildStatus: true
)
}
...
}
...