From 7bc7cd39d95562778f20bdd39f7abc1533870f72 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Mon, 25 Jul 2016 18:41:35 +0000 Subject: Bug 1286987 - When the cisco-spark keyword is added to an existing bug, please have the BMO bot send info to Spark --- extensions/Push/lib/Connector/Spark.pm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'extensions/Push/lib/Connector/Spark.pm') 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; + } } } -- cgit v1.2.3-24-g4f1b