Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ public class BitbucketBuildStatusNotificationsTrait extends SCMSourceTrait {
*/
private boolean disableNotificationForNotBuildJobs;

/**
* Should not send any notification to Bitbucket
*/
private boolean disableNotifications;

/**
* Constructor.
*
Expand Down Expand Up @@ -85,13 +90,27 @@ public boolean getDisableNotificationForNotBuildJobs() {
return this.disableNotificationForNotBuildJobs;
}

@DataBoundSetter
public void setDisableNotifications(boolean isNotificationDisabled) {
disableNotifications = isNotificationDisabled;
}

/**
* @return if builds notifications will be communicated
*/
public boolean getDisableNotifications() {
return this.disableNotifications;
}


/**
* {@inheritDoc}
*/
@Override
protected void decorateContext(SCMSourceContext<?, ?> context) {
((BitbucketSCMSourceContext) context).withDisableNotificationForNotBuildJobs(getDisableNotificationForNotBuildJobs());
((BitbucketSCMSourceContext) context).withSendSuccessNotificationForUnstableBuild(getSendSuccessNotificationForUnstableBuild());
((BitbucketSCMSourceContext) context).withNotificationsDisabled(getDisableNotifications());
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form">
<f:entry title="${%Do no communicate builds status to Bitbucket}" field="disableNotifications">
<f:checkbox/>
</f:entry>
<f:entry title="${%Communicate unstable builds to Bitbucket as successful}" field="sendSuccessNotificationForUnstableBuild">
<f:checkbox/>
</f:entry>
Expand Down