summaryrefslogtreecommitdiffstats
path: root/Bugzilla/WebService
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2015-07-10 07:37:23 +0200
committerByron Jones <glob@mozilla.com>2015-07-10 07:37:23 +0200
commit6d535a5b6b5f8636306024c3839bcbd9754ee4b1 (patch)
tree0103ef1a9569237ca60a4fc8bf7cc2db4a01237a /Bugzilla/WebService
parent65e910a8df06895d07b595c842c013f7f8c98dff (diff)
downloadbugzilla-6d535a5b6b5f8636306024c3839bcbd9754ee4b1.tar.gz
bugzilla-6d535a5b6b5f8636306024c3839bcbd9754ee4b1.tar.xz
Bug 1182387: add bug.votes to api responses
Diffstat (limited to 'Bugzilla/WebService')
-rw-r--r--Bugzilla/WebService/Bug.pm6
1 files changed, 6 insertions, 0 deletions
diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm
index 0956ddd8d..fa66edb80 100644
--- a/Bugzilla/WebService/Bug.pm
+++ b/Bugzilla/WebService/Bug.pm
@@ -24,6 +24,7 @@ package Bugzilla::WebService::Bug;
use strict;
use base qw(Bugzilla::WebService);
+use feature 'state';
use Bugzilla::Comment;
use Bugzilla::Comment::TagWeights;
@@ -1322,6 +1323,11 @@ sub _bug_to_hash {
whiteboard => $self->type('string', $bug->status_whiteboard),
} };
+ state $voting_enabled //= $bug->can('votes') ? 1 : 0;
+ if ($voting_enabled && filter_wants $params, 'votes') {
+ $item{votes} = $self->type('int', $bug->votes);
+ }
+
# First we handle any fields that require extra work (such as date parsing
# or SQL calls).
if (filter_wants $params, 'assigned_to') {