summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorDavid Lawrence <dkl@mozilla.com>2016-04-04 18:27:33 +0200
committerDavid Lawrence <dkl@mozilla.com>2016-04-04 18:27:33 +0200
commit6be9f0a286b2e9abf0119173a9e66c37a7d9f0a1 (patch)
tree281e3dd2dac6dbc3f2ec2756e099082cc0d31dc5 /Bugzilla
parent206927e1d3a9fcf73becf83d0376a92a7f0ecd0d (diff)
downloadbugzilla-6be9f0a286b2e9abf0119173a9e66c37a7d9f0a1.tar.gz
bugzilla-6be9f0a286b2e9abf0119173a9e66c37a7d9f0a1.tar.xz
Bug 880163 - add a webservice method to list a bug's duplicates, mirroring what is visible on show_bug.
r=dylan
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/API/1_0/Resource/Bug.pm3
-rw-r--r--Bugzilla/WebService/Bug.pm7
2 files changed, 10 insertions, 0 deletions
diff --git a/Bugzilla/API/1_0/Resource/Bug.pm b/Bugzilla/API/1_0/Resource/Bug.pm
index 5dc61e8d1..781ac3176 100644
--- a/Bugzilla/API/1_0/Resource/Bug.pm
+++ b/Bugzilla/API/1_0/Resource/Bug.pm
@@ -1491,6 +1491,9 @@ sub _bug_to_hash {
if (filter_wants $params, 'tags', 'extra') {
$item{'tags'} = $bug->tags;
}
+ if (filter_wants $params, 'duplicates', 'extra') {
+ $item{'duplicates'} = [ map { as_int($_->id) } @{ $bug->duplicates } ];
+ }
# And now custom fields
my @custom_fields = Bugzilla->active_custom_fields;
diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm
index a1c6b7d99..2279395a1 100644
--- a/Bugzilla/WebService/Bug.pm
+++ b/Bugzilla/WebService/Bug.pm
@@ -1377,6 +1377,9 @@ sub _bug_to_hash {
if (filter_wants $params, 'tags', 'extra') {
$item{'tags'} = $bug->tags;
}
+ if (filter_wants $params, 'duplicates', 'extra') {
+ $item{'duplicates'} = [ map { $self->type('int', $_->id) } @{ $bug->duplicates } ];
+ }
# And now custom fields
my @custom_fields = Bugzilla->active_custom_fields;
@@ -2590,6 +2593,10 @@ C<array> of C<string>s. Each array item is a tag name.
Note that tags are personal to the currently logged in user.
+=item C<duplicates>
+
+C<array> of C<integers>. Each array item is a bug ID that is a duplicate of this bug.
+
=back
=item C<faults> B<EXPERIMENTAL>