Bugzilla::Webservice::Bug - The API for creating, changing, and getting the details of bugs.
This part of the Bugzilla API allows you to file a new bug in Bugzilla, or get information about bugs that have already been filed.
See Bugzilla::WebService for a description of how parameters are passed, and what STABLE, UNSTABLE, and EXPERIMENTAL mean.
Although the data input and output is the same for JSON-RPC, XML-RPC and REST, the directions for how to access the data via REST is noted in each method where applicable.
UNSTABLE
Get information about valid bug fields, including the lists of legal values for each field.
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/<id_or_name>
The returned data format is the same as below.
You can pass either field ids or field names.
Note: If neither ids nor names is specified,
then all non-obsolete fields will be returned.
In addition to the parameters below, this method also accepts the standard include_fields and exclude_fields arguments.
ids (array) - An array of integer field ids.names (array) - An array of strings representing field names.A hash containing a single element,
fields.
This is an array of hashes,
containing the following keys:
idint An integer id uniquely identifying this field in this installation only.
typeint The number of the fieldtype.
The following values are defined:
0 Unknown1 Free Text2 Drop Down3 Multiple-Selection Box4 Large Text Box5 Date/Time6 Bug Id7 Bug URLs ("See Also")is_customboolean True when this is a custom field,
false otherwise.
namestring The internal name of this field.
This is a unique identifier for this field.
If this is not a custom field,
then this name will be the same across all Bugzilla installations.
display_namestring The name of the field,
as it is shown in the user interface.
is_mandatoryboolean True if the field must have a value when filing new bugs.
Also,
mandatory fields cannot have their value cleared when updating bugs.
is_on_bug_entryboolean For custom fields,
this is true if the field is shown when you enter a new bug.
For standard fields,
this is currently always false,
even if the field shows up when entering a bug.
(To know whether or not a standard field is valid on bug entry,
see "create".)
visibility_fieldstring The name of a field that controls the visibility of this field in the user interface.
This field only appears in the user interface when the named field is equal to one of the values in visibility_values.
Can be null.
visibility_valuesarray of strings This field is only shown when visibility_field matches one of these values.
When visibility_field is null,
then this is an empty array.
value_fieldstring The name of the field that controls whether or not particular values of the field are shown in the user interface.
Can be null.
valuesThis is an array of hashes,
representing the legal values for select-type (drop-down and multiple-selection) fields.
This is also populated for the component,
version,
target_milestone,
and keywords fields,
but not for the product field (you must use Product.get_accessible_products for that.
For fields that aren't select-type fields, this will simply be an empty array.
Each hash has the following keys:
namestring The actual value--this is what you would specify for this field in "create",
etc.
sort_keyint Values,
when displayed in a list,
are sorted first by this integer and then secondly by their name.
sortkeyDEPRECATED - Use sort_key instead.
visibility_valuesIf value_field is defined for this field,
then this value is only shown if the value_field is set to one of the values listed in this array.
Note that for per-product fields,
value_field is set to 'product' and visibility_values will reflect which product(s) this value appears in.
descriptionstring The description of the value.
This item is only included for the keywords field.
is_openboolean For bug_status values,
determines whether this status specifies that the bug is "open" (true) or "closed" (false).
This item is only included for the bug_status field.
can_change_toFor bug_status values,
this is an array of hashes that determines which statuses you can transition to from this status.
(This item is only included for the bug_status field.)
Each hash contains the following items:
namethe name of the new status
comment_requiredthis boolean True if a comment is required when you change a bug into this status using this transition.
You specified an invalid field name or id.
is_mandatory return value was added in Bugzilla 4.0.sortkey was renamed to sort_key in Bugzilla 4.2.UNSTABLE
Get information about valid flag types that can be set for bugs and attachments.
You have several options for retreiving information about flag types. The first part is the request method and the rest is the related path needed.
To get information about all flag types for a product:
GET /flag_types/<product>
To get information about flag_types for a product and component:
GET /flag_types/<product>/<component>
The returned data format is the same as below.
You must pass a product name and an optional component name.
product (string) - The name of a valid product.component (string) - An optional valid component name associated with the product.A hash containing two keys,
bug and attachment.
Each key value is an array of hashes,
containing the following keys:
idint An integer id uniquely identifying this flag type.
namestring The name for the flag type.
typestring The target of the flag type which is either bug or attachment.
descriptionstring The description of the flag type.
valuesarray An array of string values that the user can set on the flag type.
is_requesteebleboolean Users can ask specific other users to set flags of this type.
is_multiplicableboolean Multiple flags of this type can be set for the same bug or attachment.
Either the product does not exist or you don't have access to it.
The component provided does not exist in the product.
DEPRECATED - Use "fields" instead.
Tells you what values are allowed for a particular field.
To get information on the values for a field based on field name:
GET /field/bug/<field_name>/values
To get information based on field name and a specific product:
GET /field/bug/<field_name>/<product_id>/values
The returned data format is the same as below.
field - The name of the field you want information about.
This should be the same as the name you would use in "create",
below.product_id - If you're picking a product-specific field,
you have to specify the id of the product you want the values for.values - An array of strings: the legal values for this field.
The values will be sorted as they normally would be in Bugzilla.
You were required to specify a product, and either you didn't, or you specified an invalid product (or a product that you can't access).
You specified a field that doesn't exist or isn't a drop-down field.
EXPERIMENTAL
It allows you to get data about attachments, given a list of bugs and/or attachment ids.
Note: Private attachments will only be returned if you are in the insidergroup or if you are the submitter of the attachment.
To get all current attachments for a bug:
GET /bug/<bug_id>/attachment
To get a specific attachment based on attachment ID:
GET /bug/attachment/<attachment_id>
The returned data format is the same as below.
Note: At least one of ids or attachment_ids is required.
idsSee the description of the ids parameter in the "get" method.
attachment_idsarray An array of integer attachment ids.
Also accepts the include_fields, and exclude_fields arguments.
A hash containing two elements: bugs and attachments.
The return value looks like this:
{
bugs => {
1345 => [
{ (attachment) },
{ (attachment) }
],
9874 => [
{ (attachment) },
{ (attachment) }
],
},
attachments => {
234 => { (attachment) },
123 => { (attachment) },
}
}
The attachments of any bugs that you specified in the ids argument in input are returned in bugs on output. bugs is a hash that has integer bug IDs for keys and the values are arrayrefs that contain hashes as attachments. (Fields for attachments are described below.)
For any attachments that you specified directly in attachment_ids, they are returned in attachments on output. This is a hash where the attachment ids point directly to hashes describing the individual attachment.
The fields for each attachment (where it says (attachment) in the diagram above) are:
database64 The raw data of the attachment, encoded as Base64.
sizeint The length (in bytes) of the attachment.
creation_timedateTime The time the attachment was created.
last_change_timedateTime The last time the attachment was modified.
idint The numeric id of the attachment.
bug_idint The numeric id of the bug that the attachment is attached to.
file_namestring The file name of the attachment.
summarystring A short string describing the attachment.
Also returned as description, for backwards-compatibility with older Bugzillas. (However, this backwards-compatibility will go away in Bugzilla 5.0.)
content_typestring The MIME type of the attachment.
is_privateboolean True if the attachment is private (only visible to a certain group called the "insidergroup"), False otherwise.
is_obsoleteboolean True if the attachment is obsolete, False otherwise.
is_patchboolean True if the attachment is a patch, False otherwise.
creatorstring The login name of the user that created the attachment.
Also returned as attacher, for backwards-compatibility with older Bugzillas. (However, this backwards-compatibility will go away in Bugzilla 5.0.)
creator_detailhash A hash containing detailed user information for the creator. The keys included in the user detail hash are the same as ones returned for the Get Bug method.
flagsAn array of hashes containing the information about flags currently set for each attachment. Each flag hash contains the following items:
idint The id of the flag.
namestring The name of the flag.
type_idint The type id of the flag.
creation_datedateTime The timestamp when this flag was originally created.
modification_datedateTime The timestamp when the flag was last modified.
statusstring The current status of the flag.
setterstring The login name of the user who created or last modified the flag.
requesteestring The login name of the user this flag has been requested to be granted or denied. Note, this field is only returned if a requestee is set.
This method can throw all the same errors as "get". In addition, it can also throw the following error:
You specified the id of a private attachment in the attachment_ids argument, and you are not in the "insider group" that can see private attachments.
attacher return value was renamed to creator.description return value was renamed to summary.data return value was added in Bugzilla 4.0.is_url return value was removed (this attribute no longer exists for attachments).flags array was added in Bugzilla 4.4.creator_detail field was added in Bugzilla 6.0.STABLE
This allows you to get data about comments, given a list of bugs and/or comment ids.
To get all comments for a particular bug using the bug ID or alias:
GET /bug/<id_or_alias>/comment
To get a specific comment based on the comment ID:
GET /bug/comment/<comment_id>
The returned data format is the same as below.
Note: At least one of ids or comment_ids is required.
In addition to the parameters below, this method also accepts the standard include_fields and exclude_fields arguments.
idsarray An array that can contain both bug IDs and bug aliases. All of the comments (that are visible to you) will be returned for the specified bugs.
comment_idsarray An array of integer comment_ids. These comments will be returned individually, separate from any other comments in their respective bugs.
new_sincedateTime If specified, the method will only return comments newer than this time. This only affects comments returned from the ids argument. You will always be returned all comments you request in the comment_ids argument, even if they are older than this date.
skip_private EXPERIMENTALboolean Normally, if you request any inaccessible or invalid bug ids, this method will throw an error. If this parameter is True, these bugs will just be skipped. In the future, error objects will be returned instead, just like Bug.get with the permissive parameter provided.
Two items are returned:
bugsThis is used for bugs specified in ids. This is a hash, where the keys are the numeric ids of the bugs, and the value is a hash with a single key, comments, which is an array of comments. (The format of comments is described below.)
Note that any individual bug will only be returned once, so if you specify an id multiple times in ids, it will still only be returned once.
commentsEach individual comment requested in comment_ids is returned here, in a hash where the numeric comment id is the key, and the value is the comment. (The format of comments is described below.)
A "comment" as described above is a hash that contains the following keys:
int The globally unique ID for the comment.
int The ID of the bug that this comment is on.
int If the comment was made on an attachment, this will be the ID of that attachment. Otherwise it will be null.
string The body of the comment, including any special text (such as "this bug was marked as a duplicate of...").
string The body of the comment without any special additional text.
string The login name of the comment's author.
Also returned as author, for backwards-compatibility with older Bugzillas. (However, this backwards-compatibility will go away in Bugzilla 5.0.)
dateTime The time (in Bugzilla's timezone) that the comment was added.
dateTime This is exactly same as the time key. Use this field instead of time for consistency with other methods including "get" and "attachments". For compatibility, time is still usable. However, please note that time may be deprecated and removed in a future release.
boolean True if this comment is private (only visible to a certain group called the "insidergroup"), False otherwise.
This method can throw all the same errors as "get". In addition, it can also throw the following errors:
You specified the id of a private comment in the comment_ids argument, and you are not in the "insider group" that can see private comments.
You specified an id in the comment_ids argument that is invalid--either you specified something that wasn't a number, or there is no comment with that id.
attachment_id was added to the return value in Bugzilla 3.6.author return value was renamed to creator.creation_time was added in Bugzilla 4.4.raw_text was added in Bugzilla 6.0.STABLE
Gets information about particular bugs in the database.
Note: Can also be called as "get_bugs" for compatibility with Bugzilla 3.0 API.
To get information about a particular bug using its ID or alias:
GET /bug/<id_or_alias>
The returned data format is the same as below.
In addition to the parameters below, this method also accepts the standard include_fields and exclude_fields arguments.
idsAn array of numbers and strings.
If an element in the array is entirely numeric, it represents a bug_id from the Bugzilla database to fetch. If it contains any non-numeric characters, it is considered to be a bug alias instead, and the bug with that alias will be loaded.
Note that it's possible for aliases to be disabled in Bugzilla, in which case you will be told that you have specified an invalid bug_id if you try to specify an alias. (It will be error 100.)
permissive EXPERIMENTALboolean Normally, if you request any inaccessible or invalid bug ids, Bug.get will throw an error. If this parameter is True, instead of throwing an error we return an array of hashes with a id, faultString and faultCode for each bug that fails, and return normal information for the other bugs that were accessible.
Two items are returned:
bugsAn array of hashes that contains information about the bugs with the valid ids. Each hash contains the following items:
These fields are returned by default or by specifying _default in include_fields.
actual_timedouble The total number of hours that this bug has taken (so far).
If you are not in the time-tracking group, this field will not be included in the return value.
aliasstring The unique alias of this bug.
assigned_tostring The login name of the user to whom the bug is assigned.
assigned_to_detailhash A hash containing detailed user information for the assigned_to. To see the keys included in the user detail hash, see below.
attachmentsarray of hashes containing attachment details of the bug. See the attachments section above for the object format.
This is an extra field returned only by specifying attachments or _extra in include_fields.
blocksarray of ints. The ids of bugs that are "blocked" by this bug.
ccarray of strings. The login names of users on the CC list of this bug.
cc_detailarray of hashes containing detailed user information for each of the cc list members. To see the keys included in the user detail hash, see below.
classificationstring The name of the current classification the bug is in.
comment_countint The number of the comments left on this bug.
commentsarray of hashes containing comment details of the bug. See the comments section above for the object format.
This is an extra field returned only by specifying comments or _extra in include_fields.
componentstring The name of the current component of this bug.
countsUNSTABLE
hash A hash containing the numbers of the items in the following fields: attachments, cc, comments, keywords, blocks, depends_on, regressed_by, regressions and duplicates.
This is an extra field returned only by specifying counts or _extra in include_fields.
creation_timedateTime When the bug was created.
creatorstring The login name of the person who filed this bug (the reporter).
creator_detailhash A hash containing detailed user information for the creator. To see the keys included in the user detail hash, see below.
deadlinestring The day that this bug is due to be completed, in the format YYYY-MM-DD.
If you are not in the time-tracking group, this field will not be included in the return value.
depends_onarray of ints. The ids of bugs that this bug "depends on".
descriptionstring The description (initial comment) of the bug.
This is an extra field returned only by specifying description or _extra in include_fields.
dupe_ofint The bug ID of the bug that this bug is a duplicate of. If this bug isn't a duplicate of any bug, this will be null.
duplicatesarray of ints. The ids of bugs that are marked as duplicate of this bug.
estimated_timedouble The number of hours that it was estimated that this bug would take.
If you are not in the time-tracking group, this field will not be included in the return value.
filed_viaHow the bug was filed, e.g. standard_form.
This is an extra field returned only by specifying filed_via or _extra in include_fields.
flagsAn array of hashes containing the information about flags currently set for the bug. Each flag hash contains the following items:
idint The id of the flag.
namestring The name of the flag.
type_idint The type id of the flag.
creation_datedateTime The timestamp when this flag was originally created.
modification_datedateTime The timestamp when the flag was last modified.
statusstring The current status of the flag.
setterstring The login name of the user who created or last modified the flag.
requesteestring The login name of the user this flag has been requested to be granted or denied. Note, this field is only returned if a requestee is set.
groupsarray of strings. The names of all the groups that this bug is in.
historyarray of hashes containing change details of the bug. See the history section below for the object format.
This is an extra field returned only by specifying history or _extra in include_fields.
idint The unique numeric id of this bug.
is_cc_accessibleboolean If true, this bug can be accessed by members of the CC list, even if they are not in the groups the bug is restricted to.
is_confirmedboolean True if the bug has been confirmed. Usually this means that the bug has at some point been moved out of the UNCONFIRMED status and into another open status.
is_openboolean True if this bug is open, false if it is closed.
is_creator_accessibleboolean If true, this bug can be accessed by the creator (reporter) of the bug, even if they're not a member of the groups the bug is restricted to.
keywordsarray of strings. Each keyword that is on this bug.
last_change_timedateTime When the bug was last changed.
op_sysstring The name of the operating system that the bug was filed against.
platformstring The name of the platform (hardware) that the bug was filed against.
prioritystring The priority of the bug.
productstring The name of the product this bug is in.
qa_contactstring The login name of the current QA Contact on the bug.
qa_contact_detailhash A hash containing detailed user information for the qa_contact. To see the keys included in the user detail hash, see below.
regressed_byarray of ints. The ids of bugs that introduced this bug.
regressionsarray of ints. The ids of bugs bugs that are introduced by this bug.
remaining_timedouble The number of hours of work remaining until work on this bug is complete.
If you are not in the time-tracking group, this field will not be included in the return value.
resolutionstring The current resolution of the bug, or an empty string if the bug is open.
see_alsoUNSTABLE
array of strings. The URLs in the See Also field on the bug.
severitystring The current severity of the bug.
statusstring The current status of the bug.
summarystring The summary of this bug.
target_milestonestring The milestone that this bug is supposed to be fixed by, or for closed bugs, the milestone that it was fixed for.
triage_ownerstring The login name of the Triage Owner of the bug's component.
This is an extra field returned only by specifying triage_owner or _extra in include_fields.
triage_owner_detailhash A hash containing detailed user information for the triage_owner. To see the keys included in the user detail hash, see below.
As with triage_owner, this is an extra field returned only by specifying triage_owner or _extra in include_fields.
typestring The type of the bug.
update_tokenstring The token that you would have to pass to the process_bug.cgi page in order to update this bug. This changes every time the bug is updated.
This field is not returned to logged-out users.
urlUNSTABLE
string A URL that demonstrates the problem described in the bug, or is somehow related to the bug report.
versionstring The version the bug was reported against.
whiteboardstring The value of the "status whiteboard" field on the bug.
Every custom field in this installation will also be included in the return value. Most fields are returned as strings. However, some field types have different return values.
Normally custom fields are returned by default similar to normal bug fields or you can specify only custom fields by using _custom in include_fields.
intarray of strings.dateTimeEach user detail hash contains the following items:
idint The user id for this user.
real_namestring The 'real' name for this user, if any.
nickstring The user's nickname. Currently this is extracted from the real_name, name or email field.
namestring The user's Bugzilla login.
emailstring The user's email address. Currently this is the same value as the name.
faults EXPERIMENTALAn array of hashes that contains invalid bug ids with error messages returned for them. Each hash contains the following items:
int The numeric bug_id of this bug.
c<string> This will only be returned for invalid bugs if the permissive argument was set when calling Bug.get, and it is an error indicating that the bug id was invalid.
c<int> This will only be returned for invalid bugs if the permissive argument was set when calling Bug.get, and it is the error code for the invalid bug error.
If you specified an alias and either: (a) the Bugzilla you're querying doesn't support aliases or (b) there is no bug with that alias.
The bug_id you specified doesn't exist in the database.
You do not have access to the bug_id you specified.
permissive argument added to this method's params in Bugzilla 3.4.bugsfaultsbugs return value: blocks, cc, classification, creator, deadline, depends_on, estimated_time, is_cc_accessible, is_confirmed, is_creator_accessible, groups, keywords, op_sys, platform, qa_contact, remaining_time, see_also, target_milestone, update_token, url, version, whiteboard, and all custom fields.flags array was added in Bugzilla 4.4.actual_time item was added to the bugs return value in Bugzilla 4.4.attachments, comment_count, comments, counts, description, duplicates, filed_via, history, regressed_by, regressions, triage_owner and type fields were added in Bugzilla 6.0.EXPERIMENTAL
Gets the history of changes for particular bugs in the database.
To get the history for a specific bug ID:
GET /bug/<bug_id>/history
The returned data format will be the same as below.
idsAn array of numbers and strings.
If an element in the array is entirely numeric, it represents a bug_id from the Bugzilla database to fetch. If it contains any non-numeric characters, it is considered to be a bug alias instead, and the data bug with that alias will be loaded.
item new_since
dateTime If specified, the method will only return changes newer than this time.
Note that it's possible for aliases to be disabled in Bugzilla, in which case you will be told that you have specified an invalid bug_id if you try to specify an alias. (It will be error 100.)
skip_private EXPERIMENTALboolean Normally, if you request any inaccessible or invalid bug ids, this method will throw an error. If this parameter is True, these bugs will just be skipped. In the future, error objects will be returned instead, just like Bug.get with the permissive parameter provided.
A hash containing a single element, bugs. This is an array of hashes, containing the following keys:
int The numeric id of the bug.
string The alias of this bug. If there is no alias or aliases are disabled in this Bugzilla, this will be undef.
array An array of hashes, each hash having the following keys:
dateTime The date the bug activity/change happened.
string The login name of the user who performed the bug change.
array An array of hashes which contain all the changes that happened to the bug at this time (as specified by when). Each hash contains the following items:
string The name of the bug field that has changed.
string The previous value of the bug field which has been deleted by the change.
string The new value of the bug field which has been added by the change.
int The id of the attachment that was changed. This only appears if the change was to an attachment, otherwise attachment_id will not be present in this hash.
The same as "get".
UNSTABLE
Allows a user to find possible duplicate bugs based on a set of keywords such as a user may use as a bug summary. Optionally the search can be narrowed down to specific products.
summary (string) Required - A string of keywords defining the type of bug you are trying to report.product (array) - One or more product names to narrow the duplicate search to. If omitted, all bugs are searched.The same as "get".
Note that you will only be returned information about bugs that you can see. Bugs that you can't see will be entirely excluded from the results. So, if you want to see private bugs, you will have to first log in and then call this method.
You must specify a value for summary containing a string of keywords to search for duplicates.
UNSTABLE
Allows you to search for bugs based on particular criteria.
To search for bugs:
GET /bug
The URL parameters and the returned data format are the same as below.
Unless otherwise specified in the description of a parameter, bugs are returned if they match exactly the criteria you specify in these parameters. That is, we don't match against substrings--if a bug is in the "Widgets" product and you ask for bugs in the "Widg" product, you won't get anything.
Criteria are joined in a logical AND. That is, you will be returned bugs that match all of the criteria, not bugs that match any of the criteria.
Each parameter can be either the type it says, or an array of the types it says. If you pass an array, it means "Give me bugs with any of these values." For example, if you wanted bugs that were in either the "Foo" or "Bar" products, you'd pass:
product => ['Foo', 'Bar']
Some Bugzillas may treat your arguments case-sensitively, depending on what database system they are using. Most commonly, though, Bugzilla is not case-sensitive with the arguments passed (because MySQL is the most-common database to use with Bugzilla, and MySQL is not case sensitive).
In addition to the fields listed below, you may also use criteria that is similar to what is used in the Advanced Search screen of the Bugzilla UI. This includes fields specified by Search by Change History and Custom Search. The easiest way to determine what the field names are and what format Bugzilla expects, is to first construct your query using the Advanced Search UI, execute it and use the query parameters in they URL as your key/value pairs for the WebService call. With REST, you can just reuse the query parameter portion in the REST call itself.
aliasstring The unique alias for this bug. Note that you can search by alias even if the alias field is disabled in this Bugzilla, but it's likely that there won't be any aliases set on bugs, in that case.
assigned_tostring The login name of a user that a bug is assigned to.
componentstring The name of the Component that the bug is in. Note that if there are multiple Components with the same name, and you search for that name, bugs in all those Components will be returned. If you don't want this, be sure to also specify the product argument.
creation_timedateTime Searches for bugs that were created at this time or later. May not be an array.
creatorstring The login name of the user who created the bug.
You can also pass this argument with the name reporter, for backwards compatibility with older Bugzillas.
descriptionstring The description (initial comment) of the bug.
filed_viastring Searches for bugs that were created with this method.
idint The numeric id of the bug.
last_change_timedateTime Searches for bugs that were modified at this time or later. May not be an array.
limitint Limit the number of results returned to int records. If the limit is more than zero and higher than the maximum limit set by the administrator, then the maximum limit will be used instead. If you set the limit equal to zero, then all matching results will be returned instead.
offsetint Used in conjunction with the limit argument, offset defines the starting position for the search. For example, given a search that would return 100 bugs, setting limit to 10 and offset to 10 would return bugs 11 through 20 from the set of 100.
op_sysstring The "Operating System" field of a bug.
platformstring The Platform (sometimes called "Hardware") field of a bug.
prioritystring The Priority field on a bug.
productstring The name of the Product that the bug is in.
resolutionstring The current resolution--only set if a bug is closed. You can find open bugs by searching for bugs with an empty resolution.
severitystring The Severity field on a bug.
statusstring The current status of a bug (not including its resolution, if it has one, which is a separate field above).
summarystring Searches for substrings in the single-line Summary field on bugs. If you specify an array, then bugs whose summaries match any of the passed substrings will be returned.
Note that unlike searching in the Bugzilla UI, substrings are not split on spaces. So searching for foo bar will match "This is a foo bar" but not "This foo is a bar". ['foo', 'bar'], would, however, match the second item.
target_milestonestring The Target Milestone field of a bug. Note that even if this Bugzilla does not have the Target Milestone field enabled, you can still search for bugs by Target Milestone. However, it is likely that in that case, most bugs will not have a Target Milestone set (it defaults to "---" when the field isn't enabled).
qa_contactstring The login name of the bug's QA Contact. Note that even if this Bugzilla does not have the QA Contact field enabled, you can still search for bugs by QA Contact (though it is likely that no bug will have a QA Contact set, if the field is disabled).
triage_ownerstring The login name of the Triage Owner of a bug's component.
typestring The Type field on a bug.
urlstring The "URL" field of a bug.
versionstring The Version field of a bug.
whiteboardstring Search the "Status Whiteboard" field on bugs for a substring. Works the same as the summary field described above, but searches the Status Whiteboard field.
count_onlyboolean If count_only set to true, only a single hash key called bug_count will be returned which is the number of bugs that matched the search.
quicksearchstring Search for bugs using quicksearch syntax.
The same as "get".
Note that you will only be returned information about bugs that you can see. Bugs that you can't see will be entirely excluded from the results. So, if you want to see private bugs, you will have to first log in and then call this method.
If you specify an invalid value for a particular field, you just won't get any results for that value.
You may not search without any search terms.
votes was removed in Bugzilla 4.0.reporter input parameter was renamed to creator in Bugzilla 4.0.limit is set equal to zero. Otherwise maximum results returned are limited by system configuration.description field was added in Bugzilla 6.0.STABLE
This allows you to create a new bug in Bugzilla. If you specify any invalid fields, an error will be thrown stating which field is invalid. If you specify any fields you are not allowed to set, they will just be set to their defaults or ignored.
You cannot currently set all the items here that you can set on enter_bug.cgi.
The WebService interface may allow you to set things other than those listed here, but realize that anything undocumented is UNSTABLE and will very likely change in the future.
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.
Some params must be set, or an error will be thrown. These params are marked Required.
Some parameters can have defaults set in Bugzilla, by the administrator. If these parameters have defaults set, you can omit them. These parameters are marked Defaulted.
Clients that want to be able to interact uniformly with multiple Bugzillas should always set both the params marked Required and those marked Defaulted, because some Bugzillas may not have defaults set for Defaulted parameters, and then this method will throw an error if you don't specify them.
The descriptions of the parameters below are what they mean when Bugzilla is being used to track software bugs. They may have other meanings in some installations.
product (string) Required - The name of the product the bug is being filed against.component (string) Required - The name of a component in the product above.summary (string) Required - A brief description of the bug being filed.version (string) Required - A version of the product above; the version the bug was found in.description (string) Defaulted - The description (initial comment) of the bug. Some Bugzilla installations require this to not be blank.filed_via (string) Defaulted - How the bug is being filed. It will be api by default when filing through the API.op_sys (string) Defaulted - The operating system the bug was discovered on.platform (string) Defaulted - What type of hardware the bug was experienced on.priority (string) Defaulted - What order the bug will be fixed in by the developer, compared to the developer's other bugs.severity (string) Defaulted - How severe the bug is.type (string) Defaulted - The basic category of the bug. Some Bugzilla installations require this to be specified.alias (string) - A brief alias for the bug that can be used instead of a bug number when accessing this bug. Must be unique in all of this Bugzilla.assigned_to (username) - A user to assign this bug to, if you don't want it to be assigned to the component owner.cc (array) - An array of usernames to CC on this bug.comment_is_private (boolean) - If set to true, the description is private, otherwise it is assumed to be public.comment_tags (array) - An array of strings to add as comment tags to the description.groups (array) - An array of group names to put this bug into. You can see valid group names on the Permissions tab of the Preferences screen, or, if you are an administrator, in the Groups control panel. If you don't specify this argument, then the bug will be added into all the groups that are set as being "Default" for this product. (If you want to avoid that, you should specify groups as an empty array.)qa_contact (username) - If this installation has QA Contacts enabled, you can set the QA Contact here if you don't want to use the component's default QA Contact.status (string) - The status that this bug should start out as. Note that only certain statuses can be set on bug creation.target_milestone (string) - A valid target milestone for this product.flagsarray An array of hashes with flags to add to the bug. To create a flag, at least the status and the type_id or name must be provided. An optional requestee can be passed if the flag type is requestable to a specific user.
namestring The name of the flag type.
type_idint The internal flag type id.
statusstring The flags new status (i.e. "?", "+", "-" or "X" to clear a flag).
requesteestring The login of the requestee if the flag type is requestable to a specific user.
In addition to the above parameters, if your installation has any custom fields, you can set them just by passing in the name of the field and its value as a string.
A hash with one element, id. This is the id of the newly-filed bug.
You specified a field value that is invalid. The error message will have more details.
The alias you specified is invalid for some reason. See the error message for more details.
One of the drop-down fields has an invalid value, or a value entered in a text field is too long. The error message will have more detail.
You didn't specify a component.
Either you didn't specify a product, this product doesn't exist, or you don't have permission to enter bugs in this product.
You didn't specify a summary for the bug.
You specified values in the blocks and depends_on fields, or the regressions and regressed_by fields, that would cause a circular dependency between bugs.
You tried to restrict the bug to a group which does not exist, or which you cannot use with this product.
The flag status is invalid.
You tried to request, grant, or deny a flag but only a user with the required permissions may make the change.
You can't ask a specific person for the flag.
The flag type specified matches several flag types. You must specify the type id value to update or add a flag.
The flag type is inactive and cannot be used to create new flags.
You didn't specify a type for the bug.
Either the QA Contact, Assignee, or CC lists have some invalid user in them. The error message will have more details.
groups argument was added in Bugzilla 4.0. Before Bugzilla 4.0, bugs were only added into Mandatory groups by this method. Since Bugzilla 4.0.2, passing an illegal group name will throw an error. In Bugzilla 4.0 and 4.0.1, illegal group names were silently ignored.comment_is_private argument was added in Bugzilla 4.0. Before Bugzilla 4.0, you had to use the undocumented commentprivacy argument.32000.UNSTABLE
This allows you to add an attachment to a bug in Bugzilla.
To create attachment on a current bug:
POST /bug/<bug_id>/attachment
The params to include in the POST body, as well as the returned data format are the same as below. The ids param will be overridden as it it pulled from the URL path.
idsRequired array An array of ints and/or strings--the ids or aliases of bugs that you want to add this attachment to. The same attachment and comment will be added to all these bugs.
dataRequired base64 or string The content of the attachment. If the content of the attachment is not ASCII text, you must encode it in base64 and declare it as the base64 type.
file_nameRequired string The "file name" that will be displayed in the UI for this attachment.
summaryRequired string A short string describing the attachment.
content_typeRequired string The MIME type of the attachment, like text/plain or image/png.
commentstring A comment to add along with this attachment.
is_patchboolean True if Bugzilla should treat this attachment as a patch. If you specify this, you do not need to specify a content_type. The content_type of the attachment will be forced to text/plain.
Defaults to False if not specified.
is_privateboolean True if the attachment should be private (restricted to the "insidergroup"), False if the attachment should be public.
Defaults to False if not specified.
flagsarray An array of hashes with flags to add to the attachment. to create a flag, at least the status and the type_id or name must be provided. An optional requestee can be passed if the flag type is requestable to a specific user.
namestring The name of the flag type.
type_idint The internal flag type id.
statusstring The flags new status (i.e. "?", "+", "-" or "X" to clear a flag).
requesteestring The login of the requestee if the flag type is requestable to a specific user.
bug_flagsarray An optional array of hashes with flags to add to the attachment's bug. See the flags param for the "update" method for the object format.
A single item attachments, which contains the created attachments in the same format as the attachments return value from "attachments".
This method can throw all the same errors as "get", plus:
The flag status is invalid.
You tried to request, grant, or deny a flag but only a user with the required permissions may make the change.
You can't ask a specific person for the flag.
The flag type specified matches several flag types. You must specify the type id value to update or add a flag.
The flag type is inactive and cannot be used to create new flags.
You tried to attach a file that was larger than Bugzilla will accept.
You specified a content_type argument that was blank, not a valid MIME type, or not a MIME type that Bugzilla accepts for attachments.
You did not specify a valid for the file_name argument.
You did not specify a value for the summary argument.
You set the "data" field to an empty string.
is_url parameter was removed in Bugzilla 4.2.UNSTABLE
This allows you to update attachment metadata in Bugzilla.
To update attachment metadata on a current attachment:
PUT /bug/attachment/<attach_id>
The params to include in the POST body, as well as the returned data format are the same as below. The ids param will be overridden as it it pulled from the URL path.
idsRequired array An array of integers -- the ids of the attachments you want to update.
file_namestring The "file name" that will be displayed in the UI for this attachment.
summarystring A short string describing the attachment.
commentstring An optional comment to add to the attachment's bug.
content_typestring The MIME type of the attachment, like text/plain or image/png.
is_patchboolean True if Bugzilla should treat this attachment as a patch. If you specify this, you do not need to specify a content_type. The content_type of the attachment will be forced to text/plain.
is_privateboolean True if the attachment should be private (restricted to the "insidergroup"), False if the attachment should be public.
is_obsoleteboolean True if the attachment is obsolete, False otherwise.
flagsarray An array of hashes with changes to the flags. The following values can be specified. At least the status and one of type_id, id, or name must be specified. If a type_id or name matches a single currently set flag, the flag will be updated unless new is specified.
namestring The name of the flag that will be created or updated.
type_idint The internal flag type id that will be created or updated. You will need to specify the type_id if more than one flag type of the same name exists.
statusstring The flags new status (i.e. "?", "+", "-" or "X" to clear a flag).
requesteestring The login of the requestee if the flag type is requestable to a specific user.
idint Use id to specify the flag to be updated. You will need to specify the id if more than one flag is set of the same name.
newboolean Set to true if you specifically want a new flag to be created.
bug_flagsarray An optional array of hashes with changes to the flags of the attachment's bug. See the flags param for the "update" method for the object format.
A hash with a single field, "attachment". This points to an array of hashes with the following fields:
idint The id of the attachment that was updated.
last_change_timedateTime The exact time that this update was done at, for this attachment. If no update was done (that is, no fields had their values changed and no comment was added) then this will instead be the last time the attachment was updated.
changeshash The changes that were actually done on this bug. The keys are the names of the fields that were changed, and the values are a hash with two keys:
added (string) The values that were added to this field. possibly a comma-and-space-separated list if multiple values were added.removed (string) The values that were removed from this field.Here's an example of what a return value might look like:
{
attachments => [
{
id => 123,
last_change_time => '2010-01-01T12:34:56',
changes => {
summary => {
removed => 'Sample ptach',
added => 'Sample patch'
},
is_obsolete => {
removed => '0',
added => '1',
}
},
}
]
}
This method can throw all the same errors as "get", plus:
The flag status is invalid.
You tried to request, grant, or deny a flag but only a user with the required permissions may make the change.
You can't ask a specific person for the flag.
The flag specified has been set multiple times. You must specify the id value to update the flag.
The flag type specified matches several flag types. You must specify the type id value to update or add a flag.
The flag type is inactive and cannot be used to create new flags.
You specified a content_type argument that was blank, not a valid MIME type, or not a MIME type that Bugzilla accepts for attachments.
You did not specify a valid for the file_name argument.
You did not specify a value for the summary argument.
STABLE
This allows you to add a comment to a bug in Bugzilla.
To create a comment on a current bug:
POST /bug/<bug_id>/comment
The params to include in the POST body as well as the returned data format, are the same as below.
id (int or string) Required - The id or alias of the bug to append a comment to.comment (string) Required - The comment to append to the bug. If this is empty or all whitespace, an error will be thrown saying that you did not set the comment parameter.is_private (boolean) - If set to true, the comment is private, otherwise it is assumed to be public.work_time (double) - Adds this many hours to the "Hours Worked" on the bug. If you are not in the time tracking group, this value will be ignored.comment_tags (array) - Array of strings to add as comment tags for the new comment.A hash with one element, id whose value is the id of the newly-created comment.
You specified a work_time larger than the maximum allowed value of 99999.99.
If you specified an alias and either: (a) the Bugzilla you're querying doesn't support aliases or (b) there is no bug with that alias.
The id you specified doesn't exist in the database.
You did not have the necessary rights to edit the bug.
You tried to add a private comment, but don't have the necessary rights.
You tried to add a comment longer than the maximum allowed length (65,535 characters).
is_private argument was called private, and you can still call it private for backwards-compatibility purposes if you wish.assigned_to_detail, creator_detail, qa_contact_detail.UNSTABLE
Allows you to update the fields of a bug. Automatically sends emails out about the changes.
To update the fields of a current bug:
PUT /bug/<bug_id>
The params to include in the PUT body as well as the returned data format, are the same as below. The ids param will be overridden as it is pulled from the URL path.
idsArray of ints or strings. The ids or aliases of the bugs that you want to modify.
Note: All following fields specify the values you want to set on the bugs you are updating.
alias(string) The alias of the bug. You can only set this if you are modifying a single bug. If there is more than one bug specified in ids, passing in a value for alias will cause an error to be thrown.
assigned_tostring The full login name of the user this bug is assigned to.
blocksdepends_onhash These specify the bugs that this bug blocks or depends on, respectively. To set these, you should pass a hash as the value. The hash may contain the following fields:
add An array of ints. Bug ids to add to this field.remove An array of ints. Bug ids to remove from this field. If the bug ids are not already in the field, they will be ignored.set An array of ints. An exact set of bug ids to set this field to, overriding the current value. If you specify set, then add and remove will be ignored.cchash The users on the cc list. To modify this field, pass a hash, which may have the following fields:
add Array of strings. User names to add to the CC list. They must be full user names, and an error will be thrown if you pass in an invalid user name.remove Array of strings. User names to remove from the CC list. They must be full user names, and an error will be thrown if you pass in an invalid user name.is_cc_accessibleboolean Whether or not users in the CC list are allowed to access the bug, even if they aren't in a group that can normally access the bug.
commenthash. A comment on the change. The hash may contain the following fields:
body string The actual text of the comment. Note: For compatibility with the parameters to "add_comment", you can also call this field comment, if you want.is_private boolean Whether the comment is private or not. If you try to make a comment private and you don't have the permission to, an error will be thrown.comment_is_privatehash This is how you update the privacy of comments that are already on a bug. This is a hash, where the keys are the int id of comments (not their count on a bug, like #1, #2, #3, but their globally-unique id, as returned by "comments") and the value is a boolean which specifies whether that comment should become private (true) or public (false).
The comment ids must be valid for the bug being updated. Thus, it is not practical to use this while updating multiple bugs at once, as a single comment id will never be valid on multiple bugs.
comment_tagsarray An array of strings to add as comment tags for the new comment.
componentstring The Component the bug is in.
deadlinestring The Deadline field--a date specifying when the bug must be completed by, in the format YYYY-MM-DD.
dupe_ofint The bug that this bug is a duplicate of. If you want to mark a bug as a duplicate, the safest thing to do is to set this value and not set the status or resolution fields. They will automatically be set by Bugzilla to the appropriate values for duplicate bugs.
estimated_timedouble The total estimate of time required to fix the bug, in hours. This is the total estimate, not the amount of time remaining to fix it.
flagsarray An array of hashes with changes to the flags. The following values can be specified. At least the status and one of type_id, id, or name must be specified. If a type_id or name matches a single currently set flag, the flag will be updated unless new is specified.
namestring The name of the flag that will be created or updated.
type_idint The internal flag type id that will be created or updated. You will need to specify the type_id if more than one flag type of the same name exists.
statusstring The flags new status (i.e. "?", "+", "-" or "X" to clear a flag).
requesteestring The login of the requestee if the flag type is requestable to a specific user.
idint Use id to specify the flag to be updated. You will need to specify the id if more than one flag is set of the same name.
newboolean Set to true if you specifically want a new flag to be created.
groupshash The groups a bug is in. To modify this field, pass a hash, which may have the following fields:
add Array of strings. The names of groups to add. Passing in an invalid group name or a group that you cannot add to this bug will cause an error to be thrown.remove Array of strings. The names of groups to remove. Passing in an invalid group name or a group that you cannot remove from this bug will cause an error to be thrown.keywordshash Keywords on the bug. To modify this field, pass a hash, which may have the following fields:
add An array of stringss. The names of keywords to add to the field on the bug. Passing something that isn't a valid keyword name will cause an error to be thrown.remove An array of strings. The names of keywords to remove from the field on the bug. Passing something that isn't a valid keyword name will cause an error to be thrown.set An array of stringss. An exact set of keywords to set the field to, on the bug. Passing something that isn't a valid keyword name will cause an error to be thrown. Specifying set overrides add and remove.op_sysstring The Operating System ("OS") field on the bug.
platformstring The Platform or "Hardware" field on the bug.
prioritystring The Priority field on the bug.
productstring The name of the product that the bug is in. If you change this, you will probably also want to change target_milestone, version, and component, since those have different legal values in every product.
If you cannot change the target_milestone field, it will be reset to the default for the product, when you move a bug to a new product.
You may also wish to add or remove groups, as which groups are valid on a bug depends on the product. Groups that are not valid in the new product will be automatically removed, and groups which are mandatory in the new product will be automaticaly added, but no other automatic group changes will be done.
Note that users can only move a bug into a product if they would normally have permission to file new bugs in that product.
qa_contactstring The full login name of the bug's QA Contact.
is_creator_accessibleboolean Whether or not the bug's reporter is allowed to access the bug, even if they aren't in a group that can normally access the bug.
regressed_byarray of ints. The ids of bugs that introduced this bug.
regressionsarray of ints. The ids of bugs bugs that are introduced by this bug.
remaining_timedouble How much work time is remaining to fix the bug, in hours. If you set work_time but don't explicitly set remaining_time, then the work_time will be deducted from the bug's remaining_time.
reset_assigned_toboolean If true, the assigned_to field will be reset to the default for the component that the bug is in. (If you have set the component at the same time as using this, then the component used will be the new component, not the old one.)
reset_qa_contactboolean If true, the qa_contact field will be reset to the default for the component that the bug is in. (If you have set the component at the same time as using this, then the component used will be the new component, not the old one.)
resolutionstring The current resolution. May only be set if you are closing a bug or if you are modifying an already-closed bug. Attempting to set the resolution to any value (even an empty or null string) on an open bug will cause an error to be thrown.
If you change the status field to an open status, the resolution field will automatically be cleared, so you don't have to clear it manually.
see_alsohash The See Also field on a bug, specifying URLs to bugs in other bug trackers. To modify this field, pass a hash, which may have the following fields:
add An array of stringss. URLs to add to the field. Each URL must be a valid URL to a bug-tracker, or an error will be thrown.remove An array of strings. URLs to remove from the field. Invalid URLs will be ignored.severitystring The Severity field of a bug.
statusstring The status you want to change the bug to. Note that if a bug is changing from open to closed, you should also specify a resolution.
summarystring The Summary field of the bug.
target_milestonestring The bug's Target Milestone.
typestring The Type field on the bug.
urlstring The "URL" field of a bug.
versionstring The bug's Version field.
whiteboardstring The Status Whiteboard field of a bug.
work_timedouble The number of hours worked on this bug as part of this change. If you set work_time but don't explicitly set remaining_time, then the work_time will be deducted from the bug's remaining_time.
You can also set the value of any custom field by passing its name as a parameter, and the value to set the field to. For multiple-selection fields, the value should be an array of strings.
A hash with a single field, "bugs". This points to an array of hashes with the following fields:
idint The id of the bug that was updated.
aliasstring The alias of the bug that was updated, if aliases are enabled and this bug has an alias.
last_change_timedateTime The exact time that this update was done at, for this bug. If no update was done (that is, no fields had their values changed and no comment was added) then this will instead be the last time the bug was updated.
changeshash The changes that were actually done on this bug. The keys are the names of the fields that were changed, and the values are a hash with two keys:
added (string) The values that were added to this field, possibly a comma-and-space-separated list if multiple values were added.removed (string) The values that were removed from this field, possibly a comma-and-space-separated list if multiple values were removed.Here's an example of what a return value might look like:
{
bugs => [
{
id => 123,
alias => 'foo',
last_change_time => '2010-01-01T12:34:56',
changes => {
status => {
removed => 'NEW',
added => 'ASSIGNED'
},
keywords => {
removed => 'bar',
added => 'qux, quo, qui',
}
},
}
]
}
Currently, some fields are not tracked in changes: comment, comment_is_private, and work_time. This means that they will not show up in the return value even if they were successfully updated. This may change in a future version of Bugzilla.
This function can throw all of the errors that "get", "create", and "add_comment" can throw, plus:
You tried to set some field to be empty, but that field cannot be empty. The error message will have more details.
You tried to set a numeric field to a value that wasn't numeric.
You tried to set a numeric field to a value larger than that field can accept.
You tried to set a negative value in a numeric field that does not accept negative values.
You specified an invalid date or time in a date/time field (such as the deadline field or a custom date/time field).
You attempted to add an invalid value to the see_also field.
You don't have permission to change a particular field to a particular value. The error message will have more detail.
You specified values in the blocks and depends_on fields, or the regressions and regressed_by fields, that would cause a circular dependency between bugs.
You specified a comment id in comment_is_private that isn't on this bug.
You specified a value for dupe_of that causes an infinite loop of duplicates.
You changed the resolution to DUPLICATE but did not specify a value for the dupe_of field.
You tried to add or remove a group that you don't have permission to modify for this bug, or you tried to add a group that isn't valid in this product.
You tried to set the status field to a closed status, but you didn't specify a resolution.
This bug has an open status, but you specified a value for the resolution field.
You tried to change from one status to another, but the status workflow rules don't allow that change.
The flag status is invalid.
You tried to request, grant, or deny a flag but only a user with the required permissions may make the change.
You can't ask a specific person for the flag.
The flag specified has been set multiple times. You must specify the id value to update the flag.
The flag type specified matches several flag types. You must specify the type id value to update or add a flag.
The flag type is inactive and cannot be used to create new flags.
new_since parameter if Bugzilla 5.0.EXPERIMENTAL
Adds or removes URLs for the "See Also" field on bugs. These URLs must point to some valid bug in some Bugzilla installation or in Launchpad.
idsArray of ints or strings. The ids or aliases of bugs that you want to modify.
addArray of strings. URLs to Bugzilla bugs. These URLs will be added to the See Also field. They must be valid URLs to show_bug.cgi in a Bugzilla installation or to a bug filed at launchpad.net.
If the URLs don't start with http:// or https://, it will be assumed that http:// should be added to the beginning of the string.
It is safe to specify URLs that are already in the "See Also" field on a bug--they will just be silently ignored.
removeArray of strings. These URLs will be removed from the See Also field. You must specify the full URL that you want removed. However, matching is done case-insensitively, so you don't have to specify the URL in exact case, if you don't want to.
If you specify a URL that is not in the See Also field of a particular bug, it will just be silently ignored. Invaild URLs are currently silently ignored, though this may change in some future version of Bugzilla.
NOTE: If you specify the same URL in both add and remove, it will be added. (That is, add overrides remove.)
changes, a hash where the keys are numeric bug ids and the contents are a hash with one key, see_also. see_also points to a hash, which contains two keys, added and removed. These are arrays of strings, representing the actual changes that were made to the bug.
Here's a diagram of what the return value looks like for updating bug ids 1 and 2:
{
changes => {
1 => {
see_also => {
added => (an array of bug URLs),
removed => (an array of bug URLs),
}
},
2 => {
see_also => {
added => (an array of bug URLs),
removed => (an array of bug URLs),
}
}
}
}
This return value allows you to tell what this method actually did. It is in this format to be compatible with the return value of a future Bug.update method.
This method can throw all of the errors that "get" throws, plus:
You did not have the necessary rights to edit the bug.
One of the URLs you provided did not look like a valid bug URL.
You did not have the necessary rights to edit the See Also field for this bug.
UNSTABLE
Returns the HTML rendering of the provided comment text.
textRequired strings Text comment text to render.
idint The ID of the bug to render the comment against.
html containing the HTML rendering.
This method can throw all of the errors that "get" throws.