Only show latest build status on Bitbucket from Jenkins pipeline

830 Views Asked by At

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:

Checkbox in job's settings

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
       )
    }

    ...
}
...
1

There are 1 best solutions below

0
On

Without having the Plugin installed but I also need often the translation from GUI to scripted pipeline. You can use this tool shipped with jenkins:

https://yourJenkins/pipeline-syntax/

You will find your plugin with GUI and can generate the script.