diff --git a/src/main/java/org/jenkinsci/plugins/bitbucket/BitbucketBuildStatusHelper.java b/src/main/java/org/jenkinsci/plugins/bitbucket/BitbucketBuildStatusHelper.java index 5c03689..f7989b7 100644 --- a/src/main/java/org/jenkinsci/plugins/bitbucket/BitbucketBuildStatusHelper.java +++ b/src/main/java/org/jenkinsci/plugins/bitbucket/BitbucketBuildStatusHelper.java @@ -245,8 +245,8 @@ public static void notifyBuildStatus(UsernamePasswordCredentials credentials, bo // if previous build was manually aborted by the user and revision is the same than the current one // then update the bitbucket build status resource with current status and current build number for (BitbucketBuildStatusResource prevBuildStatusResource : prevBuildStatusResources) { - if (prevBuildStatusResource.getCommitId().equals(buildStatusResource.getCommitId())) { - BitbucketBuildStatus prevBuildStatus = createBitbucketBuildStatusFromBuild(prevBuild, overrideLatestBuild); + if (prevBuildStatusResource.getCommitId().equals(buildStatusResource.getCommitId()) && overrideLatestBuild) { + BitbucketBuildStatus prevBuildStatus = createBitbucketBuildStatusFromBuild(prevBuild, true); buildStatus.setKey(prevBuildStatus.getKey()); break;