From 77ef1abbcc12440cfb2c1af271467e9e14b388ba Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Mon, 9 Mar 2015 14:40:38 +0800 Subject: Bug 1140234: extend review/flag_activity to allow filtering by status and bug_id --- extensions/Review/lib/WebService.pm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'extensions/Review/lib') diff --git a/extensions/Review/lib/WebService.pm b/extensions/Review/lib/WebService.pm index 24d38b2f1..76c79a758 100644 --- a/extensions/Review/lib/WebService.pm +++ b/extensions/Review/lib/WebService.pm @@ -110,7 +110,7 @@ sub flag_activity { $match_criteria{type_id} = [map { $_->id } @$flag_types]; } - for my $user_field (qw( requestee setter )) { + foreach my $user_field (qw( requestee setter )) { if (my $user_name = $params->{$user_field}) { my $user = Bugzilla::User->check({ name => $user_name, cache => 1, _error => 'invalid_username' }); @@ -118,6 +118,12 @@ sub flag_activity { } } + foreach my $field (qw( bug_id status )) { + if (exists $params->{$field}) { + $match_criteria{$field} = $params->{$field}; + } + } + ThrowCodeError('param_required', { param => 'limit', function => 'Review.flag_activity()' }) if defined $params->{offset} && !defined $params->{limit}; @@ -398,6 +404,10 @@ Note that searching by C is not reliable because when flags are removed =item C (string) - the flag type name of a change +=item C (string) - The flag's current status + +=item C (int) - The flag's bug id + =back =item B -- cgit v1.2.3-24-g4f1b