From 384d1d254d14bafc3fdf62a08668c6cb36249563 Mon Sep 17 00:00:00 2001 From: Dave Lawrence Date: Fri, 12 Jul 2013 16:39:50 -0400 Subject: Bug 866927 - Enhance Bugzilla WebServices to allow data access using REST r=glob,a=justdave --- Bugzilla/WebService/Bug.pm | 149 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 147 insertions(+), 2 deletions(-) (limited to 'Bugzilla/WebService/Bug.pm') diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm index 5522af2bd..391ea69bc 100644 --- a/Bugzilla/WebService/Bug.pm +++ b/Bugzilla/WebService/Bug.pm @@ -1075,6 +1075,10 @@ or get information about bugs that have already been filed. See L for a description of how parameters are passed, and what B, B, and B mean. +Although the data input and output is the same for JSONRPC, XMLRPC and REST, +the directions for how to access the data via REST is noted in each method +where applicable. + =head1 Utility Functions =head2 fields @@ -1088,11 +1092,26 @@ B Get information about valid bug fields, including the lists of legal values for each field. +=item B + +You have several options for retreiving information about fields. The first +part is the request method and the rest is the related path needed. + +To get information about all fields: + +GET /field/bug + +To get information related to a single field: + +GET /field/bug/ + +The returned data format is the same as below. + =item B You can pass either field ids or field names. -B: If neither C nor C is specified, then all +B: If neither C nor C is specified, then all non-obsolete fields will be returned. In addition to the parameters below, this method also accepts the @@ -1288,6 +1307,8 @@ You specified an invalid field name or id. =item C return key for C was added in Bugzilla B<4.4>. +=item REST API call added in Bugzilla B<5.0> + =back =back @@ -1303,6 +1324,18 @@ B - Use L instead. Tells you what values are allowed for a particular field. +=item B + +To get information on the values for a field based on field name: + +GET /field/bug//values + +To get information based on field name and a specific product: + +GET /field/bug///values + +The returned data format is the same as below. + =item B =over @@ -1335,6 +1368,14 @@ You specified a field that doesn't exist or isn't a drop-down field. =back +=item B + +=over + +=item REST API call added in Bugzilla B<5.0>. + +=back + =back =head1 Bug Information @@ -1353,6 +1394,18 @@ and/or attachment ids. B: Private attachments will only be returned if you are in the insidergroup or if you are the submitter of the attachment. +=item B + +To get all current attachments for a bug: + +GET /bug//attachment + +To get a specific attachment based on attachment ID: + +GET /bug/attachment/ + +The returned data format is the same as below. + =item B B: At least one of C or C is required. @@ -1550,6 +1603,8 @@ C. =item The C array was added in Bugzilla B<4.4>. +=item REST API call added in Bugzilla B<5.0>. + =back =back @@ -1566,6 +1621,18 @@ B This allows you to get data about comments, given a list of bugs and/or comment ids. +=item B + +To get all comments for a particular bug using the bug ID or alias: + +GET /bug//comment + +To get a specific comment based on the comment ID: + +GET /bug/comment/ + +The returned data format is the same as below. + =item B B: At least one of C or C is required. @@ -1711,6 +1778,8 @@ C. =item C was added in Bugzilla B<4.4>. +=item REST API call added in Bugzilla B<5.0>. + =back =back @@ -1728,6 +1797,14 @@ Gets information about particular bugs in the database. Note: Can also be called as "get_bugs" for compatibilty with Bugzilla 3.0 API. +=item B + +To get information about a particular bug using its ID or alias: + +GET /bug/ + +The returned data format is the same as below. + =item B In addition to the parameters below, this method also accepts the @@ -2060,6 +2137,8 @@ You do not have access to the bug_id you specified. =item The following properties were added to this method's return values in Bugzilla B<3.4>: +=item REST API call added in Bugzilla B<5.0> + =over =item For C @@ -2117,6 +2196,14 @@ B Gets the history of changes for particular bugs in the database. +=item B + +To get the history for a specific bug ID: + +GET /bug//history + +The returned data format will be the same as below. + =item B =over @@ -2208,6 +2295,8 @@ The same as L. consistent with other methods. Since Bugzilla B<4.4>, they now match names used by L for consistency. +=item REST API call added Bugzilla B<5.0>. + =back =back @@ -2223,6 +2312,14 @@ B Allows you to search for bugs based on particular criteria. +=item + +To search for bugs: + +GET /bug + +The URL parameters and the returned data format are the same as below. + =item B Unless otherwise specified in the description of a parameter, bugs are @@ -2408,6 +2505,8 @@ in Bugzilla B<4.0>. C is set equal to zero. Otherwise maximum results returned are limited by system configuration. +=item REST API call added in Bugzilla B<5.0>. + =back =back @@ -2434,10 +2533,19 @@ The WebService interface may allow you to set things other than those listed here, but realize that anything undocumented is B and will very likely change in the future. +=item B + +To create a new bug in Bugzilla: + +POST /bug + +The params to include in the POST body as well as the returned data format, +are the same as below. + =item B Some params must be set, or an error will be thrown. These params are -marked B. +marked B. Some parameters can have defaults set in Bugzilla, by the administrator. If these parameters have defaults set, you can omit them. These parameters @@ -2598,6 +2706,8 @@ loop errors had a generic code of C<32000>. =item The ability to file new bugs with a C was added in Bugzilla B<4.4>. +=item REST API call added in Bugzilla B<5.0>. + =back =back @@ -2613,6 +2723,16 @@ B This allows you to add an attachment to a bug in Bugzilla. +=item B + +To create attachment on a current bug: + +POST /bug//attachment + +The params to include in the POST body, as well as the returned +data format are the same as below. The C param will be +overridden as it it pulled from the URL path. + =item B =over @@ -2710,6 +2830,8 @@ You set the "data" field to an empty string. =item The return value has changed in Bugzilla B<4.4>. +=item REST API call added in Bugzilla B<5.0>. + =back =back @@ -2725,6 +2847,15 @@ B This allows you to add a comment to a bug in Bugzilla. +=item B + +To create a comment on a current bug: + +POST /bug//comment + +The params to include in the POST body as well as the returned data format, +are the same as below. + =item B =over @@ -2800,6 +2931,8 @@ purposes if you wish. =item Before Bugzilla B<3.6>, error 54 and error 114 had a generic error code of 32000. +=item REST API call added in Bugzilla B<5.0>. + =back =back @@ -2816,6 +2949,16 @@ B Allows you to update the fields of a bug. Automatically sends emails out about the changes. +=item B + +To update the fields of a current bug: + +PUT /bug/ + +The params to include in the PUT body as well as the returned data format, +are the same as below. The C param will be overridden as it is +pulled from the URL path. + =item B =over @@ -3260,6 +3403,8 @@ rules don't allow that change. =item Added in Bugzilla B<4.0>. +=item REST API call added Bugzilla B<5.0>. + =back =back -- cgit v1.2.3-24-g4f1b