Update Stash Build Status does not update correctly

We recently started using bitbucket server so added the update stash build status event.

Unfortunately this does not seem to be working correctly.  It posts each event to the server - It posts the text (Building, Successful) but does not tell the server that the build has finished… so every branch gets stuck with a permanent ‘build in progress’ icon which blocks closing pull requests.

I suspect it would be possible to build something with an HTTP event handler… has anyone done that and got it working? 

Hi Tony,

The Update Stash Build Status build event handler calls this method of the BitBucketServer Build REST API. It sends a state of INPROGRESS when the stage selected as the Start Stage starts and a state of SUCCESSFUL or FAILED when the stage selected as the End Stage completes (or when the build completes). It should therefore never be left with a status of INPROGRESS unless there is a bug or the final stage is waiting for promotion (note that there is also an option to complete the build when waiting for promotion). We have just tested this with the latest version of BitBucket Server and it works as expected.

Can you check the build log and look under Event Handlers for the stage select as End Stage and check that the event handler has been run? How many builds are shown in the builds dialog for the relevant commit on BitBucket Server (e.g. when you click on the build status message) - are they all set to “in progress” or is there more than one BitBucket build per Continua CI build?

Note that each status update uses the build version as a key. If you change the build version in your stage actions it is possible that there may be two build statuses for each Continua CI build each with a different key. We will need to look in to allowing the key to be changed to a different identifier to deal with this issue. 

If you send us (to support@finalbuilder.com) a copy of the build log and a screenshot of the builds dialog for the relevant commit on BitBucket Server then we’ll look into what is going on in your case. Also let us know what your workflow settings are for pull requests so we can see why this is stopping you closing the pull request.