summaryrefslogtreecommitdiffstats
path: root/extensions/Push/lib/Connector
diff options
context:
space:
mode:
authorDavid Lawrence <dkl@mozilla.com>2016-07-25 20:41:35 +0200
committerDavid Lawrence <dkl@mozilla.com>2016-07-25 20:41:35 +0200
commit7bc7cd39d95562778f20bdd39f7abc1533870f72 (patch)
tree86490a0ee74e3f7d53f21309fc4137ceaf03d7cd /extensions/Push/lib/Connector
parentf265ae617423422d3773e767746d9c39381aa8c1 (diff)
downloadbugzilla-7bc7cd39d95562778f20bdd39f7abc1533870f72.tar.gz
bugzilla-7bc7cd39d95562778f20bdd39f7abc1533870f72.tar.xz
Bug 1286987 - When the cisco-spark keyword is added to an existing bug, please have the BMO bot send info to Spark
Diffstat (limited to 'extensions/Push/lib/Connector')
-rw-r--r--extensions/Push/lib/Connector/Spark.pm12
1 files changed, 8 insertions, 4 deletions
diff --git a/extensions/Push/lib/Connector/Spark.pm b/extensions/Push/lib/Connector/Spark.pm
index a8b5bf056..548b2ab54 100644
--- a/extensions/Push/lib/Connector/Spark.pm
+++ b/extensions/Push/lib/Connector/Spark.pm
@@ -21,7 +21,7 @@ use Bugzilla::Util qw(correct_urlbase);
use JSON qw(decode_json encode_json);
use LWP::UserAgent;
-use List::MoreUtils qw(none);
+use List::MoreUtils qw(any);
sub options {
return (
@@ -68,10 +68,14 @@ sub should_send {
return 1;
}
else {
- # send status and resolution updates
foreach my $change (@{ $data->{event}->{changes} }) {
- return 1 if $change->{field} eq 'bug_status'
- || $change->{field} eq 'resolution';
+ # send status and resolution updates
+ return 1 if $change->{field} eq 'bug_status' || $change->{field} eq 'resolution';
+ # also send if the right keyword has been added to this bug
+ if ($change->{field} eq 'keywords' && $change->{added}) {
+ my @added = split(/, /, $change->{added});
+ return 1 if any { $_ eq 'cisco-spark' } @added;
+ }
}
}