]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 880163 - add a webservice method to list a bug's duplicates, mirroring what is...
authorDavid Lawrence <dkl@mozilla.com>
Mon, 4 Apr 2016 16:27:33 +0000 (16:27 +0000)
committerDavid Lawrence <dkl@mozilla.com>
Mon, 4 Apr 2016 16:27:33 +0000 (16:27 +0000)
r=dylan

Bugzilla/API/1_0/Resource/Bug.pm
Bugzilla/WebService/Bug.pm
docs/en/rst/api/core/v1/bug.rst

index 5dc61e8d1ba3b9e7dcc3d0b22a0c776fa5cdbca6..781ac3176f1d2b40e004fa2a9601ec29ddaf8900 100644 (file)
@@ -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;
index a1c6b7d998945d74b631ba60c415f6178528e85a..2279395a14e31c52345191ba463d2a609de8bb9f 100644 (file)
@@ -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>
index f4ca0dac4b58222ec9e497e20b1b4aabf0fa88a2..e13b171296630a98bc99560aa323026a8c5fa5ff 100644 (file)
@@ -234,13 +234,14 @@ Extra fields:
 These fields are returned only by specifying ``_extra`` or the field name in
 ``include_fields``.
 
-====  =====  ====================================================================
-name  type   description
-====  =====  ====================================================================
-tags  array  Each array item is a tag name. Note that tags are
-             personal to the currently logged in user and are not the same as
-             comment tags.
-====  =====  ====================================================================
+==========  =====  ====================================================================
+name        type   description
+==========  =====  ====================================================================
+tags        array  Each array item is a tag name. Note that tags are
+                   personal to the currently logged in user and are not the same as
+                   comment tags.
+duplicates  array  Each array item is a bug ID that is a duplicate of this bug.
+==========  =====  ====================================================================
 
 User object: