Extract the conditions before the loop, as they do not change due to channel definition.
F6UHDFJXXDNY5MHXOTH6S33MCSE7RXMQI3ZYJESK4QESFDT4FLLQC
KUORZDSR56BT6GF3E4SM6JJ3IH5UIFYAEIQ3I3AX367T63Q4QVQAC
my $jobName = showJobName $b; my $buildStatus = $b->buildstatus; my $cancelledOrAborted = $buildStatus == 4 || $buildStatus == 3;
my $jobName = showJobName $b;
my $buildStatus = $b->buildstatus;
my $cancelledOrAborted = $buildStatus == 4 || $buildStatus == 3;
my $sameAsPrevious = defined $prevBuild && ($buildStatus == $prevBuild->buildstatus);
# If build is cancelled or aborted, do not send email. next if ! $force && ($b->buildstatus == 4 || $b->buildstatus == 3);
# If build is cancelled or aborted, do not send email.
next if ! $force && ($b->buildstatus == 4 || $b->buildstatus == 3);
# If build is cancelled or aborted, do not send Slack notification. next if ! $force && $cancelledOrAborted;
# If build is cancelled or aborted, do not send Slack notification.
next if ! $force && $cancelledOrAborted;
# with same buildstatus, do not send email. next if ! $force && defined $prevBuild && ($b->buildstatus == $prevBuild->buildstatus);
# with same buildstatus, do not send email.
next if ! $force && defined $prevBuild && ($b->buildstatus == $prevBuild->buildstatus);
# with same buildstatus, do not send Slack notification. next if ! $force && $sameAsPrevious;
# with same buildstatus, do not send Slack notification.
next if ! $force && $sameAsPrevious;