5.7.89. Bugzilla::WebService::Bug¶
5.7.89.1. NAME¶
Bugzilla::Webservice::Bug - The API for creating, changing, and getting the details of bugs.
5.7.89.2. DESCRIPTION¶
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.
5.7.89.3. METHODS¶
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 JSONRPC, XMLRPC and REST, the directions for how to access the data via REST is noted in each method where applicable.
5.7.89.4. Utility Functions¶
fields¶
UNSTABLE
- Description
Get information about valid bug fields, including the lists of legal values for each field.
- REST
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 /rest/field/bug
To get information related to a single field:
GET /rest/field/bug/<id_or_name>
The returned data format is the same as below.
- Params
You can pass either field ids or field names.
Note: If neither
idsnornamesis 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.
- Returns
A hash containing a single element,
fields. This is an array of hashes, containing the following keys:
idintAn integer id uniquely identifying this field in this installation only.
type
intThe number of the fieldtype. The following values are defined:
0Unknown1Free Text2Drop Down3Multiple-Selection Box4Large Text Box5Date/Time6Bug Id7Bug URLs (“See Also”)8Keywords9Date10Integer value
is_custombooleanTrue when this is a custom field, false otherwise.
namestringThe 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_namestringThe name of the field, as it is shown in the user interface.
is_mandatorybooleanTrue 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_entrybooleanFor 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_fieldstringThe 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 invisibility_values. Can be null.
visibility_valuesarrayofstrings This field is only shown whenvisibility_fieldmatches one of these values. Whenvisibility_fieldis null, then this is an empty array.
value_fieldstringThe 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, andkeywordsfields, but not for theproductfield (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:
namestringThe actual value–this is what you would specify for this field in create, etc.
sort_keyintValues, when displayed in a list, are sorted first by this integer and then secondly by their name.
sortkeyDEPRECATED - Usesort_keyinstead.
visibility_valuesIfvalue_fieldis defined for this field, then this value is only shown if thevalue_fieldis set to one of the values listed in this array. Note that for per-product fields,value_fieldis set to'product'andvisibility_valueswill reflect which product(s) this value appears in.
is_activebooleanThis value is defined only for certain product specific fields such as version, target_milestone or component. When true, the value is active, otherwise the value is not active.
descriptionstringThe description of the value. This item is only included for thekeywordsfield.
is_openbooleanForbug_statusvalues, determines whether this status specifies that the bug is “open” (true) or “closed” (false). This item is only included for thebug_statusfield.
can_change_toFor
bug_statusvalues, this is an array of hashes that determines which statuses you can transition to from this status. (This item is only included for thebug_statusfield.)Each hash contains the following items:
namethe name of the new status
comment_requiredthisbooleanTrue if a comment is required when you change a bug into this status using this transition.
- Errors
- 51 (Invalid Field Name or Id)
You specified an invalid field name or id.
- History
- Added in Bugzilla 3.6.
- The
is_mandatoryreturn value was added in Bugzilla 4.0.sortkeywas renamed tosort_keyin Bugzilla 4.2.is_activereturn key forvalueswas added in Bugzilla 4.4.- REST API call added in Bugzilla 5.0
flag_types¶
UNSTABLE
- Description
Get information about valid flag types that can be set for bugs and attachments.
- REST
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.
- Params
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.
- Returns
A hash containing two keys,
bugandattachment. Each key value is an array of hashes, containing the following keys:
idintAn integer id uniquely identifying this flag type.
namestringThe name for the flag type. Flag names do not need to be unique.
typestringThe target of the flag type which is eitherbugorattachment.
descriptionstringThe description of the flag type.
valuesarrayAn array of string values that the user can set on the flag type.
is_requestablebooleanUsers can ask specific other users to set flags of this type.
is_multiplicablebooleanMultiple flags of this type can be set for the same bug or attachment.
- Errors
- 106 (Product Access Denied)
Either the product does not exist or you don’t have access to it.
- 51 (Invalid Component)
The component provided does not exist in the product.
- History
- Added in Bugzilla 5.0. Red Hat added this in Bugzilla 4.4.2015
legal_values¶
DEPRECATED - Use fields instead.
- Description
Tells you what values are allowed for a particular field.
- REST
To get information on the values for a field based on field name:
GET /rest/field/bug/<field_name>/values
To get information based on field name and a specific product:
GET /rest/field/bug/<field_name>/<product_id>/values
The returned data format is the same as below.
- Params
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.
- Returns
values- An array of strings: the legal values for this field. The values will be sorted as they normally would be in Bugzilla.
- Errors
- 106 (Invalid Product)
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).
- 108 (Invalid Field Name)
You specified a field that doesn’t exist or isn’t a drop-down field.
- History
- REST API call added in Bugzilla 5.0.
5.7.89.5. Bug Information¶
attachments¶
EXPERIMENTAL
- Description
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.
- REST
To get all current attachments for a bug:
GET /rest/bug/<bug_id>/attachment
To get a specific attachment based on attachment ID:
GET /rest/bug/attachment/<attachment_id>
The returned data format is the same as below.
- Params
Note: At least one of
idsorattachment_idsis required.
idsSee the description of theidsparameter in the get method.
attachment_idsarrayAn array of integer attachment ids.Also accepts the include_fields, and exclude_fields arguments.
- Returns
A hash containing two elements:
bugsandattachments. 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
idsargument in input are returned inbugson output.bugsis 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 inattachmentson 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:
database64The raw data of the attachment, encoded as Base64.
sizeintThe length (in bytes) of the attachment.
creation_timedateTimeThe time the attachment was created.
last_change_timedateTimeThe last time the attachment was modified.
idintThe numeric id of the attachment.
bug_idintThe numeric id of the bug that the attachment is attached to.
file_namestringThe file name of the attachment.
summarystringA short string describing the attachment.
content_typestringThe MIME type of the attachment.
is_private
booleanTrue if the attachment is private (only visible to a certain group called the “insidergroup”), False otherwise.Defaults to your setting under General Preferences (which is a Red Hat customisation).
is_obsoletebooleanTrue if the attachment is obsolete, False otherwise.
is_patchbooleanTrue if the attachment is a patch, False otherwise.
creatorstringThe login name of the user that created the attachment.
flagsAn array of hashes containing the information about flags currently set for each attachment. Each flag hash contains the following items:
idintThe id of the flag.
namestringThe name of the flag.
type_idintThe type id of the flag.
creation_datedateTimeThe timestamp when this flag was originally created.
modification_datedateTimeThe timestamp when the flag was last modified.
statusstringThe current status of the flag.
setterstringThe login name of the user who created or last modified the flag.
requesteestringThe 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.
is_activeRed Hat ExtensionintIf the FlagType that this flag belongs to is active or not
- Errors
This method can throw all the same errors as get. In addition, it can also throw the following error:
- 304 (Auth Failure, Attachment is Private)
You specified the id of a private attachment in theattachment_idsargument, and you are not in the “insider group” that can see private attachments.
- History
- Added in Bugzilla 3.6.
- In Bugzilla 4.0, the
attacherreturn value was renamed tocreator.- In Bugzilla 4.0, the
descriptionreturn value was renamed tosummary.- The
datareturn value was added in Bugzilla 4.0.- In Bugzilla 4.2, the
is_urlreturn value was removed (this attribute no longer exists for attachments).- The
sizereturn value was added in Bugzilla 4.4.- The
flagsarray was added in Bugzilla 4.4.- REST API call added in Bugzilla 5.0.
comments¶
STABLE
- Description
This allows you to get data about comments, given a list of bugs and/or comment ids.
- REST
To get all comments for a particular bug using the bug ID or alias:
GET /rest/bug/<id_or_alias>/comment
To get a specific comment based on the comment ID:
GET /rest/bug/comment/<comment_id>
The returned data format is the same as below.
- Params
Note: At least one of
idsorcomment_idsis required.In addition to the parameters below, this method also accepts the standard include_fields and exclude_fields arguments.
idsarrayAn 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_idsarrayAn array of integer comment_ids. These comments will be returned individually, separate from any other comments in their respective bugs.
new_sincedateTimeIf specified, the method will only return comments newerthan this time. This only affects comments returned from theidsargument. You will always be returned all comments you request in thecomment_idsargument, even if they are older than this date.
- Returns
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 Defaults to your setting under General Precomment_idsis 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:
- id
intThe globally unique ID for the comment.
- bug_id
intThe ID of the bug that this comment is on.
- attachment_id
intIf the comment was made on an attachment, this will be the ID of that attachment. Otherwise it will be null.
- count
intThe number of the comment local to the bug. The Description is 0, comments start with 1.
- text
stringThe actual text of the comment.
- creator
stringThe login name of the comment’s author.
- creator_id
The internal login id of the comment’s author. This is a Red Hat Extension.
- time
dateTimeThe time (in Bugzilla’s timezone) that the comment was added.
- creation_time
dateTimeThis is exactly same as thetimekey. Use this field instead oftimefor consistency with other methods including get and attachments. For compatibility,timeis still usable. However, please note thattimemay be deprecated and removed in a future release.
- is_private
booleanTrue if this comment is private (only visible to a certain group called the “insidergroup”), False otherwise.Defaults to your setting under General Preferences (which is a Red Hat customisation).
- private_groups
An
array of stringscontaining the names of groups set on this private comment.This field is only visible to a certain group called the “insidergroup”.
This is a Red Hat customization
- Errors
This method can throw all the same errors as get. In addition, it can also throw the following errors:
- 110 (Comment Is Private)
You specified the id of a private comment in thecomment_idsargument, and you are not in the “insider group” that can see private comments.
- 111 (Invalid Comment ID)
You specified an id in thecomment_idsargument that is invalid–either you specified something that wasn’t a number, or there is no comment with that id.
- History
- Added in Bugzilla 3.4.
attachment_idwas added to the return value in Bugzilla 3.6.- In Bugzilla 4.0, the
authorreturn value was renamed tocreator.countwas added to the return value in Bugzilla 4.4.creation_timewas added in Bugzilla 4.4.- REST API call added in Bugzilla 5.0.
get¶
STABLE
- Description
Gets information about particular bugs in the database.
- REST
To get information about a particular bug using its ID or alias:
GET /rest/bug/<id_or_alias>
The returned data format is the same as below.
- Params
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.
permissiveEXPERIMENTALbooleanNormally, 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 aid,faultStringandfaultCodefor each bug that fails, and return normal information for the other bugs that were accessible.
- Returns
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
_defaultininclude_fields.
actual_time
doubleThe 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.
aliasarrayofstrings The unique aliases of this bug. An empty array will be returned if this bug has no aliases.
assigned_tostringThe login name of the user to whom the bug is assigned.
assigned_to_detailhashA hash containing detailed user information for the assigned_to. To see the keys included in the user detail hash, see below.
blocksarrayofints. The ids of bugs that are “blocked” by this bug.
blocks_all
arrayofints. The ids of bugs that are “blocked” by this bug and its dependenecies if you can view them.This value must be specified in the include_fields or extra_fields argument.
This is a Red Hat customisation.
ccarrayofstrings. The login names of users on the CC list of this bug.
cc_detailarrayof hashes containing detailed user information for each of the cc list members. To see the keys included in the user detail hash, see below.
classificationstringThe name of the current classification the bug is in.
clone_ids
arrayof bug ids that are clones of this bug.This value must be specified in the include_fields or extra_fields argument.
This is a Red Hat customization
clones
arrayof bugs that are clones of this bug.This value must be specified in the include_fields or extra_fields argument.
This is a Red Hat customization
componentarrayThe list of current components of this bug if the bug is assigned to multiple components.
creation_timedateTimeWhen the bug was created.
creatorstringThe login name of the person who filed this bug (the reporter).
creator_detailhashA hash containing detailed user information for the creator. To see the keys included in the user detail hash, see below.
data_category
stringThe data category is a guide to users on how confidential they need to treat the contents of a bug.See the “/bugzilla.redhat.com/page.cgi?id=faq.html#data-reuse-policy” in Data Reuse Policy:https: for more deatils.
This is a Red Hat customization.
deadlinestringThe day that this bug is due to be completed, in the formatYYYY-MM-DD.
dependent_products
array-of-stringsThe names of the products that this bug affects.This value must be specified in the include_fields or extra_fields argument.
This is a Red Hat customization
depends_onarrayofints. The ids of bugs that this bug “depends on”.
depends_on_all
arrayofints. The ids of bugs that this bug “depends on” and its dependenecies if you can view them.This value must be specified in the include_fields or extra_fields argument.
This is a Red Hat customisation.
dupe_ofintThe 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.
duplicate_ids
arrayof bug ids that are duplicates of this bug.This value must be specified in the include_fields or extra_fields argument.
This is a Red Hat customization
duplicates
arrayof bugs that are duplicates of this bug.This value must be specified in the include_fields or extra_fields argument.
This is a Red Hat customization
estimated_time
doubleThe 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.
external_bugs
arrayAn array of hashes. This value must be specified in the include_fields or extra_fields argument.Each has contains the following items:
idintThe id of the external tracker bug that was updated.
bug_idintThe Red Hat Bugzilla bug number this external tracker bug is attached to.
ext_bz_idintThe id of the external tracker updated. More information is available in the type field.
ext_bz_bug_idstringThe bug id of the external tracker bug (i.e. the bug number of the external tracker)
ext_statusstringThe status of the external bug
ext_descriptionstringThe description of the external bug
ext_prioritystringThe priority of the external bug
typestructContains information about the External Tracker type.
flagsThis value must be specified in the include_fields or extra_fields argument.
An array of hashes containing the information about flags currently set for the bug. Each flag hash contains the following items:
idintThe id of the flag.
namestringThe name of the flag.
type_idintThe type id of the flag.
creation_datedateTimeThe timestamp when this flag was originally created.
modification_datedateTimeThe timestamp when the flag was last modified.
statusstringThe current status of the flag.
setterstringThe login name of the user who created or last modified the flag.
requesteestringThe 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.
groupsarrayofstrings. The names of all the groups that this bug is in.
idintThe unique numeric id of this bug.
is_cc_accessiblebooleanIf 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_confirmedbooleanTrue if the bug has been confirmed. Usually this means that the bug has at some point been moved out of theUNCONFIRMEDstatus and into another open status.
is_openbooleanTrue if this bug is open, false if it is closed.
is_creator_accessiblebooleanIf true, this bug can be accessed by the creator (reporter) of the bug, even if they are not a member of the groups the bug is restricted to.
keywordsarrayofstrings. Each keyword that is on this bug.
last_change_timedateTimeWhen the bug was last changed.
op_sysstringThe name of the operating system that the bug was filed against.
platformstringThe name of the platform (hardware) that the bug was filed against.
pool
objectthe Agile Pool, including it’s Agile Team owner, this bug belongs too.This value must be specified in the include_fields or extra_fields argument.
This is a Red Hat customisation.
prioritystringThe priority of the bug.
productstringThe name of the product this bug is in.
qa_contactstringThe login name of the current QA Contact on the bug.
qa_contact_detailhashA hash containing detailed user information for the qa_contact. To see the keys included in the user detail hash, see below.
docs_contactstringThe login name of the current Docs Contact on the bug.
remaining_time
doubleThe 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.
resolutionstringThe current resolution of the bug, or an empty string if the bug is open.
see_alsoUNSTABLE
arrayofstrings. The URLs in the See Also field on the bug.
severitystringThe current severity of the bug.
statusstringThe current status of the bug.
sub_components
arrayA hash of arrays. This value must be specified in the include_fields or extra_fields argument.Return the sub components (if any) for the bug. The key in each hash is the component name. The array is the tree representing the sub component for the component.
summarystringThe summary of this bug.
target_milestonestringThe milestone that this bug is supposed to be fixed by, or for closed bugs, the milestone that it was fixed for.
update_token
stringThe token that you would have to pass to the process_bug.cgipage in order to update this bug. This changes every time the bug is updated.This field is not returned to logged-out users.
urlUNSTABLE
stringA URL that demonstrates the problem described in the bug, or is somehow related to the bug report.
versionarrayThe list of versions the bug was reported against, if the bug has multiple versions.
target_releasearrayThe list of target releases that the bugs is supposed to fixed for.
whiteboardstringThe value of the “status whiteboard” field on the bug.
- custom fields
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
_customininclude_fields.
- Bug ID Fields -
int- Multiple-Selection Fields -
arrayofstrings.- Date/Time Fields -
dateTime
- user detail hashes
Each user detail hash contains the following items:
idintThe user id for this user.
real_namestringThe ‘real’ name for this user, if any.
namestringThe user’s Bugzilla login.
stringThe user’s email address. Currently this is the same value as the name.These fields are returned only by specifying “_extra” or the field name in “include_fields”.
tags
arrayofstrings. Each array item is a tag name.Note that tags are personal to the currently logged in user.
faultsEXPERIMENTALAn array of hashes that contains invalid bug ids with error messages returned for them. Each hash contains the following items:
- id
intThe numeric bug_id of this bug.
- faultString
stringThis will only be returned for invalid bugs if thepermissiveargument was set when calling Bug.get, and it is an error indicating that the bug id was invalid.
- faultCode
intThis will only be returned for invalid bugs if thepermissiveargument was set when calling Bug.get, and it is the error code for the invalid bug error.
- Errors
- 100 (Invalid Bug Alias)
If you specified an alias and there is no bug with that alias.
- 101 (Invalid Bug ID)
The bug_id you specified doesn’t exist in the database.
- 102 (Access Denied)
You do not have access to the bug_id you specified.
- History
permissiveargument added to this method’s params in Bugzilla 3.4.- The following properties were added to this method’s return values in Bugzilla 3.4:
- For
bugs
- assigned_to
- component
- dupe_of
- is_open
- priority
- product
- resolution
- severity
- status
faults
- In Bugzilla 4.0, the following items were added to the
bugsreturn 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.
- The
flagsarray was added in Bugzilla 4.4.- The
actual_timeitem was added to thebugsreturn value in Bugzilla 4.4.- The
docs_contact,attachments,comments,description,external_bugsandsub_componentsare all Red Hat specific extensions.- REST API call added in Bugzilla 5.0.
- In Bugzilla 5.0, the following items were added to the bugs return value:
assigned_to_detail,creator_detail,qa_contact_detail.
history¶
EXPERIMENTAL
- Description
Gets the history of changes for particular bugs in the database.
- REST
To get the history for a specific bug ID:
GET /rest/bug/<bug_id>/history
The returned data format will be the same as below.
- Params
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.
new_sincedateTimeIf specified, the method will only return changes newerthan this time.
- Returns
A hash containing a single element,
bugs. This is an array of hashes, containing the following keys:
- id
intThe numeric id of the bug.
- alias
arrayofstrings The unique aliases of this bug. An empty array will be returned if this bug has no aliases.
- history
arrayAn array of hashes, each hash having the following keys:
- when
dateTimeThe date the bug activity/change happened.
- who
stringThe login name of the user who performed the bug change.
- changes
arrayAn array of hashes which contain all the changes that happened to the bug at this time (as specified bywhen). Each hash contains the following items:
- field_name
stringThe name of the bug field that has changed.
- removed
stringThe previous value of the bug field which has been deleted by the change.
- added
stringThe new value of the bug field which has been added by the change.
- attachment_id
intThe id of the attachment that was changed. This only appears if the change was to an attachment, otherwiseattachment_idwill not be present in this hash.
- Errors
The same as get.
- History
- Added in Bugzilla 3.4.
- Field names returned by the
field_namefield changed to be consistent with other methods. Since Bugzilla 4.4, they now matchnames used by Bug.update for consistency.
- REST API call added Bugzilla 5.0.
- Added
new_sinceparameter if Bugzilla 5.0.
possible_duplicates¶
UNSTABLE
- Description
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.
- Params
summary(string) Required - A string of keywords defining the type of bug you are trying to report.products(array) - One or more product names to narrow the duplicate search to. If omitted, all bugs are searched.
- Returns
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.
- Errors
- 50 (Param Required)
You must specify a value forsummarycontaining a string of keywords to search for duplicates.
- History
- Added in Bugzilla 4.0.
- The
productparameter has been renamed toproductsin Bugzilla 5.0.
search¶
UNSTABLE
- Description
Allows you to search for bugs based on particular criteria.
- <REST>
To search for bugs:
GET /bug
The URL parameters and the returned data format are the same as below.
- Params
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 HistoryandCustom 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.
aliasarrayofstrings The unique aliases of this bug. An empty array will be returned if this bug has no aliases.
always_set_cfsboolNormally when a custom field isn’t visible on a bug it will be excluded from the record returned for bugs it is not visible on. For result sets that include bugs where it is and isn’t set this will mean that different bugs will have different field sets. If this parameter is set then custom fields will be present in all records. This is a Red Hat Extension.
include_search_panesboolInclude the DataTables searchPane information in the response. This is a Red Hat Extension.
assigned_tostringThe login name of a user that a bug is assigned to.
blockedintThe bug number that a bug blocks.
componentstringThe 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 theproductargument.
creation_timedateTimeSearches for bugs that were created at this time or later. May not be an array.
creator
stringThe 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.
idintThe numeric id of the bug.
last_change_timedateTimeSearches for bugs that were modified at this time or later. May not be an array.
limitintLimit the number of results returned tointrecords. 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.
offsetintUsed in conjunction with thelimitargument,offsetdefines the starting position for the search. For example, given a search that would return 100 bugs, settinglimitto 10 andoffsetto 10 would return bugs 11 through 20 from the set of 100.
op_sysstringThe “Operating System” field of a bug.
platformstringThe Platform (sometimes called “Hardware”) field of a bug.
prioritystringThe Priority field on a bug.
productstringThe name of the Product that the bug is in.
resolutionstringThe current resolution–only set if a bug is closed. You can find open bugs by searching for bugs with an empty resolution.
severitystringThe Severity field on a bug.
statusstringThe current status of a bug (not including its resolution, if it has one, which is a separate field above).
summary
stringSearches 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 barwill match “This is a foo bar” but not “This foo is a bar”.['foo', 'bar'], would, however, match the second item.
tags
stringSearches for a bug with the specified tag. If you specify an array, then any bugs that match any of the tags will be returned.Note that tags are personal to the currently logged in user.
target_milestonestringThe 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_contactstringThe 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).
docs_contactstringThe login name of the bug’s Docs Contact. Note that even if this Bugzilla does not have the Docs Contact field enabled, you can still search for bugs by Docs Contact (though it is likely that no bug will have a Docs Contact set, if the field is disabled).
urlstringThe “URL” field of a bug.
versionstringThe Version field of a bug.
whiteboardstringSearch the “Status Whiteboard” field on bugs for a substring. Works the same as thesummaryfield described above, but searches the Status Whiteboard field.
quicksearchstringSearch for bugs using quicksearch syntax.
- Red Hat Extension
Red Hat have extended the functionality of the search call. Specifying one of the following values overrides all of the above.
quicksearchstringPerforms a quick search (as if you used the quick search in the user interface. The quick search help page provides useful hints.
savedsearchstringPerforms a search you have saved, or that is visible to you. Note that you must be logged in to use this feature.
sharer_id
intThis is the user id of the creator of the saved search. A user id can be looked up using the User.get rpc callIf this argument is absent, it will default to the user id of the currently logged in user.
This is a top level argument and only needs to be used in conjunction with the savedsearch argument.
ids_onlyboolIf set the results will only include the bug ID’s. The bugs will be in the order requested. This bypasses the ORM and limits, and ignores offset. This is a Red Hat Extension.
- Returns
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.
Red Hat Extension
In addition to the bugs array the following fields are returned.
- total_matches:
- The total number of matches for the search. This can far exceed the search result limits.
- limit:
- The limit that was applied to the search.
- offset:
- The offset that was applied to the search.
Note: There is the chance that when using limit and offset that the data set can change while you are processing results. To avoid this you would not use
offsetand would instead setorder=bug_idin your search and rerun your search withbug_id > $largest_bug_id_processed.
- Errors
If you specify an invalid value for a particular field, you just won’t get any results for that value.
- 1000 (Parameters Required)
You may not search without any search terms.
- History
- Added in Bugzilla 3.4.
- Searching by
voteswas removed in Bugzilla 4.0.- The
reporterinput parameter was renamed tocreatorin Bugzilla 4.0.- In 4.2.6 and newer, added the ability to return all results if
limitis set equal to zero. Otherwise maximum results returned are limitedby system configuration.
- REST API call added in Bugzilla 5.0.
- Updated to allow for full search capability similar to the Bugzilla UI in Bugzilla 5.0.
- Updated to allow quicksearch capability in Bugzilla 5.0.
5.7.89.6. Bug Creation and Modification¶
create¶
STABLE
- Description
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.
- REST
To create a new bug in Bugzilla:
POST /rest/bug
The params to include in the POST body as well as the returned data format, are the same as below.
- Params
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/array) Required - Product component, provide string argument if assigning the bug to one component, for assigning multiplecomponents to the bug provide an array of the components.
summary(string) Required - A brief description of the bug being filed.version(string/array) Required - Product version, provide string argument if assigning the bug to one version, for assigning multiple versions to thebug provide an array of the versions.
target_release(string/array) Defaulted - Product target release, provide string argument if assigning the bug to one target release, for assigning multipletarget releases to the bug provide an array of the target releases.
description(string) Defaulted - The initial description for this bug. Some Bugzilla installations require this to not be blank.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.alias(array) - A brief alias for the bug that can be used instead of a bug number when accessing this bug. Must be unique inall 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. Defaults to yoursetting under General Preferences (which is a Red Hat customisation).
extra_private_groupsAn array of
strings. Groups named in this array will be added to the extra prvivate groups for the comment for this change.This is a Red Hat customisation.
groups(array) - An array of group names to put this bug into. You can see valid group names on the Permissionstab 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
groupsas 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 usethe component’s default QA Contact.
docs_contact(username) - If this installation has Docs Contacts enabled, you can set the Docs Contact here if you don’t want to usethe component’s default Docs Contact.
status(string) - The status that this bug should start out as. Note that only certain statuses can be set on bug creation.sub_components
arrayA hash of arrays.The key in each hash is the component name. The array is the tree representing the sub component for the component.
resolution(string) - If you are filing a closed bug, then you will have to specify a resolution. You cannot currently specifya resolution of
DUPLICATEfor new bugs, though. That must be done with update.
target_milestone(string) - A valid target milestone for this product.override_private(boolean) - If set to true the default_to_private setting for the component or subcomponent is ignore. This allows creating publicbugs for components that default to private.
flags
arrayAn 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.
namestringThe name of the flag type.
type_idintThe internal flag type id.
statusstringThe flags new status (i.e. “?”, “+”, “-” or “X” to clear a flag).
requesteestringThe 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.
- Returns
A hash with one element,id. This is the id of the newly-filed bug.
- Errors
- 51 (Invalid Object)
You specified a field value that is invalid. The error message will have more details.
- 103 (Invalid Alias)
The alias you specified is invalid for some reason. See the error message for more details.
- 104 (Invalid Field)
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.
- 105 (Invalid Component)
You didn’t specify a component.
- 106 (Invalid Product)
Either you didn’t specify a product, this product doesn’t exist, or you don’t have permission to enter bugs in this product.
- 107 (Invalid Summary)
You didn’t specify a summary for the bug.
- 116 (Dependency Loop)
You specified values in theblocksordepends_onfields that would cause a circular dependency between bugs.
- 120 (Group Restriction Denied)
You tried to restrict the bug to a group which does not exist, or which you cannot use with this product.
- 129 (Flag Status Invalid)
The flag status is invalid.
- 130 (Flag Modification Denied)
You tried to request, grant, or deny a flag but only a user with the required permissions may make the change.
- 131 (Flag not Requestable from Specific Person)
You can’t ask a specific person for the flag.
- 133 (Flag Type not Unique)
The flag type specified matches several flag types. You must specify the type id value to update or add a flag.
- 134 (Inactive Flag Type)
The flag type is inactive and cannot be used to create new flags.
- 504 (Invalid User)
Either the QA Contact, Assignee, or CC lists have some invalid user in them. The error message will have more details.
- History
- Before 3.0.4, parameters marked as Defaulted were actually Required, due to a bug in Bugzilla.
- The
groupsargument was added in Bugzilla 4.0. Before Bugzilla 4.0, bugs were only added into Mandatory groups by thismethod. 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.
- The
comment_is_privateargument was added in Bugzilla 4.0. Before Bugzilla 4.0, you had to use the undocumentedcommentprivacyargument.
- Error 116 was added in Bugzilla 4.0. Before that, dependency loop errors had a generic code of
32000.- The ability to file new bugs with a
resolutionwas added in Bugzilla 4.4.- REST API call added in Bugzilla 5.0.
add_attachment¶
STABLE
- Description
This allows you to add an attachment to a bug in Bugzilla.
- REST
To create attachment on a current bug:
POST /rest/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
idsparam will be overridden as it it pulled from the URL path.
- Params
idsRequiredarrayAn 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.
dataRequiredbase64orstringThe content of the attachment. If the content of the attachment is not ASCII text, you must encode it in base64 and declare it as thebase64type.
file_nameRequiredstringThe “file name” that will be displayed in the UI for this attachment.
summaryRequiredstringA short string describing the attachment.
content_typeRequiredstringThe MIME type of the attachment, liketext/plainorimage/png.
commentstringA comment to add along with this attachment.
is_patch
booleanTrue if Bugzilla should treat this attachment as a patch. If you specify this, you do not need to specify acontent_type. Thecontent_typeof the attachment will be forced totext/plain.Defaults to False if not specified.
is_private
booleanTrue if the attachment should be private (restricted to the “insidergroup”), False if the attachment should be public.Defaults to False if not specified.
flags
arrayAn 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.
namestringThe name of the flag type.
type_idintThe internal flag type id.
statusstringThe flags new status (i.e. “?”, “+”, “-” or “X” to clear a flag).
requesteestringThe login of the requestee if the flag type is requestable to a specific user.
minor_updatebooleanIf set to true, this is considered a minor update and no mail is sent to users who do not want minor update emails. If current user is not in the minor_update_group, this parameter is simply ignored.
- Returns
A single itemids, which contains an array of the attachment id(s) created.
- Errors
This method can throw all the same errors as get, plus:
- 129 (Flag Status Invalid)
The flag status is invalid.
- 130 (Flag Modification Denied)
You tried to request, grant, or deny a flag but only a user with the required permissions may make the change.
- 131 (Flag not Requestable from Specific Person)
You can’t ask a specific person for the flag.
- 133 (Flag Type not Unique)
The flag type specified matches several flag types. You must specify the type id value to update or add a flag.
- 134 (Inactive Flag Type)
The flag type is inactive and cannot be used to create new flags.
- 600 (Attachment Too Large)
You tried to attach a file that was larger than Bugzilla will accept.
- 601 (Invalid MIME Type)
You specified acontent_typeargument that was blank, not a valid MIME type, or not a MIME type that Bugzilla accepts for attachments.
- 603 (File Name Not Specified)
You did not specify a valid for thefile_nameargument.
- 604 (Summary Required)
You did not specify a value for thesummaryargument.
- 606 (Empty Data)
You set the “data” field to an empty string.
- History
- Added in Bugzilla 4.0.
- The
is_urlparameter was removed in Bugzilla 4.2.- The return value has changed in Bugzilla 4.4.
- REST API call added in Bugzilla 5.0.
update_attachment¶
UNSTABLE
- Description
This allows you to update attachment metadata in Bugzilla.
- REST
To update attachment metadata on a current attachment:
PUT /rest/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
idsparam will be overridden as it it pulled from the URL path.
- Params
idsRequiredarrayAn array of integers – the ids of the attachments you want to update.
file_namestringThe “file name” that will be displayed in the UI for this attachment.
summarystringA short string describing the attachment.
commentstringAn optional comment to add to the attachment’s bug.
content_typestringThe MIME type of the attachment, liketext/plainorimage/png.
is_patchbooleanTrue if Bugzilla should treat this attachment as a patch. If you specify this, you do not need to specify acontent_type. Thecontent_typeof the attachment will be forced totext/plain.
is_privatebooleanTrue if the attachment should be private (restricted to the “insidergroup”), False if the attachment should be public.
is_obsoletebooleanTrue if the attachment is obsolete, False otherwise.
flags
arrayAn 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.
namestringThe name of the flag that will be created or updated.
type_idintThe internal flag type id that will be created or updated. You will need to specify thetype_idif more than one flag type of the same name exists.
statusstringThe flags new status (i.e. “?”, “+”, “-” or “X” to clear a flag).
requesteestringThe login of the requestee if the flag type is requestable to a specific user.
idintUse id to specify the flag to be updated. You will need to specify theidif more than one flag is set of the same name.
newbooleanSet to true if you specifically want a new flag to be created.
minor_updatebooleanIf set to true, this is considered a minor update and no mail is sent to users who do not want minor update emails. If current user is not in the minor_update_group, this parameter is simply ignored.
- Returns
A
hashwith a single field, “attachments”. This points to an array of hashes with the following fields:
idintThe id of the attachment that was updated.
last_change_timedateTimeThe 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.
changes
hashThe 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', } }, } ] }
- Errors
This method can throw all the same errors as get, plus:
- 129 (Flag Status Invalid)
The flag status is invalid.
- 130 (Flag Modification Denied)
You tried to request, grant, or deny a flag but only a user with the required permissions may make the change.
- 131 (Flag not Requestable from Specific Person)
You can’t ask a specific person for the flag.
- 132 (Flag not Unique)
The flag specified has been set multiple times. You must specify the id value to update the flag.
- 133 (Flag Type not Unique)
The flag type specified matches several flag types. You must specify the type id value to update or add a flag.
- 134 (Inactive Flag Type)
The flag type is inactive and cannot be used to create new flags.
- 601 (Invalid MIME Type)
You specified acontent_typeargument that was blank, not a valid MIME type, or not a MIME type that Bugzilla accepts for attachments.
- 603 (File Name Not Specified)
You did not specify a valid for thefile_nameargument.
- 604 (Summary Required)
You did not specify a value for thesummaryargument.
- History
- Added in Bugzilla 5.0.
add_comment¶
STABLE
- Description
This allows you to add a comment to a bug in Bugzilla.
- REST
To create a comment on a current bug:
POST /rest/bug/<bug_id>/comment
The params to include in the POST body as well as the returned data format, are the same as below.
- Params
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 thatyou did not set the
commentparameter.
is_private(boolean) - If set to true, the comment is private, otherwise it is assumed to be public.Defaults to your setting under General Preferences (which is a Red Hat customisation).
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 willbe ignored.
minor_update(boolean) - If set to true, this is considered a minor update and no mail is sent to users who do not want minor update emails. If current useris not in the minor_update_group, this parameter is simply ignored.
extra_private_groupsarrayofstrings.Groups named in this array will be added so the specified outsider groups can see the comment.
This is a Red Hat customisation.
- Returns
A hash with one element,idwhose value is the id of the newly-created comment.
- Errors
- 54 (Hours Worked Too Large)
You specified awork_timelarger than the maximum allowed value of99999.99.
- 100 (Invalid Bug Alias)
If you specified an alias and there is no bug with that alias.
- 101 (Invalid Bug ID)
The id you specified doesn’t exist in the database.
- 109 (Bug Edit Denied)
You did not have the necessary rights to edit the bug.
- 113 (Can’t Make Private Comments)
You tried to add a private comment, but don’t have the necessary rights.
- 114 (Comment Too Long)
You tried to add a comment longer than the maximum allowed length (65,535 characters).
- History
- Added in Bugzilla 3.2.
- Modified to return the new comment’s id in Bugzilla 3.4
- Modified to throw an error if you try to add a private comment but can’t, in Bugzilla 3.4.
- Before Bugzilla 3.6, the
is_privateargument was calledprivate, and you can still call itprivatefor backwards-compatibilitypurposes if you wish.
- Before Bugzilla 3.6, error 54 and error 114 had a generic error code of 32000.
- REST API call added in Bugzilla 5.0.
update¶
UNSTABLE
- Description
Allows you to update the fields of a bug. Automatically sends emails out about the changes.
- REST
To update the fields of a current bug:
PUT /rest/bug/<bug_id>
The params to include in the PUT body as well as the returned data format, are the same as below. The
idsparam will be overridden as it is pulled from the URL path.
- Params
idsArray ofints orstrings. The ids or aliases of the bugs that you want to modify.
minor_updatebooleanIf set to true, this is considered a minor update and no mail is sent to users who do not want minor update emails. If current user is not in the minor_update_group, this parameter is simply ignored.Note: All following fields specify the values you want to set on the bugs you are updating.
alias
hashThese specify the aliases of a bug that can be used instead of a bug number when acessing this bug. To set these, you should pass a hash as the value. The hash may contain the following fields:
addAn array ofstrings. Aliases to add to this field.removeAn array ofstrings. Aliases to remove from this field. If the aliases are not already in the field, they will be ignored.setAn array ofstrings. An exact set of aliases to set this field to, overriding the current value. If you specifyset, thenaddand
removewill be ignored.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 foraliaswill cause an error to be thrown.For backwards compatibility, you can also specify a single string. This will be treated as if you specified the set key above.
assigned_tostringThe full login name of the user this bug is assigned to.
blocksdepends_on
hashThese 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:
addAn array ofints. Bug ids to add to this field.removeAn array ofints. Bug ids to remove from this field. If the bug ids are not already in the field, they will be ignored.setAn array ofints. An exact set of bug ids to set this field to, overriding the current value. If you specifyset, thenaddand
removewill be ignored.
- dependent_products
hashProducts to add, remove or overwrite the list of dependent products. The hash may contain the following fields.Note that the product you are adding dependences to must have that dependency whitelisted
A list of valid values can be fetched from Bugzilla::Extension::DependentProducts::WebService::DependentProducts
This is a Red Hat customization.
addAn array ofstrings. Product names to be added to the dependent products listremoveAn array ofstrings. Products names to be removed from the dependent products list.setAn array ofstrings. Overwrite the list of dependent products with this new set of product names.
cc
hashThe users on the cc list. To modify this field, pass a hash, which may have the following fields:
addArray ofstrings. User names to add to the CC list. They must be full user names, and an error will be thrown if you passin an invalid user name.
removeArray ofstrings. User names to remove from the CC list. They must be full user names, and an error will be thrown if youpass in an invalid user name.
is_cc_accessiblebooleanWhether 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.
comment
hash. A comment on the change. The hash may contain the following fields:
bodystringThe 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_privatebooleanWhether the comment is private or not. If you try to make a comment private and you don’t have the permissionto, an error will be thrown.
The privacy defaults to your setting under General Preferences (which is a Red Hat customisation).
comment_is_private
hashThis is how you update the privacy of comments that are already on a bug. This is a hash, where the keys are theintid 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 abooleanwhich 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_extra_private_groups
hash. This allows you to update the extra private groups on existing comments. This is a hash, where the keys are theintid of comments. Each entry is ahashconsisting of ‘set’, ‘add’, or ‘remove’ keys. Each of which contains anarrayofstrings of group names.Set, add, and remove do the obvious, if you use set the others will be ignored. If you use add and remove, remove will take precedence.
Use ‘set’ with an empty array to remove all extra private groups.
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.
This is a Red Hat customisation.
componentstring/arrayThe Components the bug is in. Not all products support multiple components. You will receive an error if you try and set multiple components to a bug that does not support this.
deadlinestringThe Deadline field–a date specifying when the bug must be completed by, in the formatYYYY-MM-DD.
dupe_ofintThe 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 thestatusorresolutionfields. They will automatically be set by Bugzilla to the appropriate values for duplicate bugs.
estimated_timedoubleThe 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.
flags
arrayAn 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.
namestringThe name of the flag that will be created or updated.
type_idintThe internal flag type id that will be created or updated. You will need to specify thetype_idif more than one flag type of the same name exists.
statusstringThe flags new status (i.e. “?”, “+”, “-” or “X” to clear a flag).
requesteestringThe login of the requestee if the flag type is requestable to a specific user.
idintUse id to specify the flag to be updated. You will need to specify theidif more than one flag is set of the same name.
newbooleanSet to true if you specifically want a new flag to be created.
groups
hashThe groups a bug is in. To modify this field, pass a hash, which may have the following fields:
addArray ofstrings. The names of groups to add. Passing in an invalid group name or a group that you cannot add to this bug willcause an error to be thrown.
removeArray ofstrings. The names of groups to remove. Passing in an invalid group name or a group that you cannot remove from this bugwill cause an error to be thrown.
keywords
hashKeywords on the bug. To modify this field, pass a hash, which may have the following fields:
addAn array ofstringss. The names of keywords to add to the field on the bug. Passing something that isn’t a valid keyword namewill cause an error to be thrown.
removeAn array ofstrings. The names of keywords to remove from the field on the bug. Passing something that isn’t a valid keywordname will cause an error to be thrown.
setAn array ofstringss. An exact set of keywords to set the field to, on the bug. Passing something that isn’t a valid keyword namewill cause an error to be thrown. Specifying
setoverridesaddandremove.
needinfo_roles
arrayAn array of user roles to needinfo on each bug. For each bug processed each role is checked and if the role has a user then that user will be needinfo’ on the bug.The supported roles are:
- assigned_to
- docs_contact
- qa_contact
- reporter
If you supply an unsupported role the ‘invalid_needinfo_role’ error will be thrown.
If you change the user in a role in the same call then the new user will be needinfo’d.
This is a Red Hat customisation.
op_sysstringThe Operating System (“OS”) field on the bug.
platformstringThe Platform or “Hardware” field on the bug.
prioritystringThe Priority field on the bug.
product
stringThe name of the product that the bug is in. If you change this, you will probably also want to changetarget_milestone,version, andcomponent, since those have different legal values in every product.If you cannot change the
target_milestonefield, 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_contactstringThe full login name of the bug’s QA Contact.
docs_contactstringThe full login name of the bug’s Docs Contact.
is_creator_accessiblebooleanWhether 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.
remaining_timedoubleHow much work time is remaining to fix the bug, in hours. If you setwork_timebut don’t explicitly setremaining_time, then thework_timewill be deducted from the bug’sremaining_time.
reset_assigned_tobooleanIf true, theassigned_tofield 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_contactbooleanIf true, theqa_contactfield 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_docs_contactbooleanIf true, thedocs_contactfield 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.)
resolution
stringThe 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
statusfield to an open status, the resolution field will automatically be cleared, so you don’t have to clear it manually.
see_also
hashThe 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:
addAn array ofstringss. URLs to add to the field. Each URL must be a valid URL to a bug-tracker, or an error willbe thrown.
removeAn array ofstrings. URLs to remove from the field. Invalid URLs will be ignored.
severitystringThe Severity field of a bug.
statusstringThe status you want to change the bug to. Note that if a bug is changing from open to closed, you should also specify aresolution.
sub_componentsA
hashcontaining aarrayof strings.Update the sub component for a bug. The key in the hash is the component name. The array of strings is the tree path representing the sub component name.
For example: {‘component’ => [‘parent_sub_component’,’child_sub_component’]}
summarystringThe Summary field of the bug.
target_milestonestringThe bug’s Target Milestone.
target_releasestring/arrayThe target releases of a bug. Not all products support multiple target releases. You will receive an error if you try and set multiple target releases to a bug that does not support this.
urlstringThe “URL” field of a bug.
versionstring/arrayThe bug’s Version field. Not all products support multiple versions. You will receive an error if you try and set multiple versions to a bug that does not support this.
whiteboardstringThe Status Whiteboard field of a bug.
work_timedoubleThe number of hours worked on this bug as part of this change. If you setwork_timebut don’t explicitly setremaining_time, then thework_timewill be deducted from the bug’sremaining_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.
Alternatively for multiple-selection custom fields, you can specify a struct with the keys ‘add’, ‘remove’ or ‘set’. The value is an array of strings of the values to add, remove or set. This is a Red Hat customisation.
- Returns
A
hashwith a single field, “bugs”. This points to an array of hashes with the following fields:
idintThe id of the bug that was updated.
aliasarrayofstrings The aliases of the bug that was updated, if this bug has any alias.
last_change_timedateTimeThe 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.
changes
hashThe 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 wereremoved.
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, andwork_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.
- Errors
This function can throw all of the errors that get, create, and add_comment can throw, plus:
- 50 (Empty Field)
You tried to set some field to be empty, but that field cannot be empty. The error message will have more details.
- 52 (Input Not A Number)
You tried to set a numeric field to a value that wasn’t numeric.
- 54 (Number Too Large)
You tried to set a numeric field to a value larger than that field can accept.
- 55 (Number Too Small)
You tried to set a negative value in a numeric field that does not accept negative values.
- 56 (Bad Date/Time)
You specified an invalid date or time in a date/time field (such as thedeadlinefield or a custom date/time field).
- 112 (See Also Invalid)
You attempted to add an invalid value to thesee_alsofield.
- 115 (Permission Denied)
You don’t have permission to change a particular field to a particular value. The error message will have more detail.
- 116 (Dependency Loop)
You specified a value in theblocksordepends_onfields that causes a dependency loop.
- 117 (Invalid Comment ID)
You specified a comment id incomment_is_privatethat isn’t on this bug.
- 118 (Duplicate Loop)
You specified a value fordupe_ofthat causes an infinite loop of duplicates.
- 119 (dupe_of Required)
You changed the resolution toDUPLICATEbut did not specify a value for thedupe_offield.
- 120 (Group Add/Remove Denied)
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.
- 121 (Resolution Required)
You tried to set thestatusfield to a closed status, but you didn’t specify a resolution.
- 122 (Resolution On Open Status)
This bug has an open status, but you specified a value for theresolutionfield.
- 123 (Invalid Status Transition)
You tried to change from one status to another, but the status workflow rules don’t allow that change.
- 129 (Flag Status Invalid)
The flag status is invalid.
- 130 (Flag Modification Denied)
You tried to request, grant, or deny a flag but only a user with the required permissions may make the change.
- 131 (Flag not Requestable from Specific Person)
You can’t ask a specific person for the flag.
- 132 (Flag not Unique)
The flag specified has been set multiple times. You must specify the id value to update the flag.
- 133 (Flag Type not Unique)
The flag type specified matches several flag types. You must specify the type id value to update or add a flag.
- 134 (Inactive Flag Type)
The flag type is inactive and cannot be used to create new flags.
- History
- Added in Bugzilla 4.0.
- REST API call added Bugzilla 5.0.
update_see_also¶
EXPERIMENTAL
- Description
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.
- Params
idsArray ofints orstrings. 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 toshow_bug.cgiin a Bugzilla installation or to a bug filed at launchpad.net.If the URLs don’t start with
http://orhttps://, it will be assumed thathttp://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.
minor_updatebooleanIf set to true, this is considered a minor update and no mail is sent to users who do not want minor update emails. If current user is not in the minor_update_group, this parameter is simply ignored.NOTE: If you specify the same URL in both
addandremove, it will be added. (That is,addoverridesremove.)
- Returns
changes, a hash where the keys are numeric bug ids and the contents are a hash with one key,see_also.see_alsopoints to a hash, which contains two keys,addedandremoved. 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.updatemethod.
- Errors
This method can throw all of the errors that get throws, plus:
- 109 (Bug Edit Denied)
You did not have the necessary rights to edit the bug.
- 112 (Invalid Bug URL)
One of the URLs you provided did not look like a valid bug URL.
- 115 (See Also Edit Denied)
You did not have the necessary rights to edit the See Also field for this bug.
- History
- Added in Bugzilla 3.4.
- Before Bugzilla 3.6, error 115 had a generic error code of 32000.
update_tags¶
UNSTABLE
- Description
Adds or removes tags on bugs.
- Params
idsRequiredarrayAn array of ints and/or strings–the ids or aliases of bugs that you want to add or remove tags to. All the tags will be added or removed to all these bugs.
tagsRequired
hashA hash representing tags to be added and/or removed. The hash has the following fields:
addAn array ofstrings representing tag names to be added to the bugs.It is safe to specify tags that are already associated with the bugs–they will just be silently ignored.
removeAn array ofstrings representing tag names to be removed from the bugs.It is safe to specify tags that are not associated with any bugs–they will just be silently ignored.
- Returns
changes, a hash containing bug IDs as keys and one single value name “tags” which is also a hash, withaddedandremovedas keys. See update_see_also for an example of how it looks like.
- Errors
This method can throw the same errors as get.
- History
- Added in Bugzilla 4.4.
search_comment_tags¶
UNSTABLE
- Description
Searches for tags which contain the provided substring.
- REST
To search for comment tags:
GET /rest/bug/comment/tags/<query>
- Params
queryRequiredstringOnly tags containg this substring will be returned.
limitintIf provided will return no more thanlimittags. Defaults to10.
- Returns
Anarray of stringsof matching tags.
- Errors
This method can throw all of the errors that get throws, plus:
- 125 (Comment Tagging Disabled)
Comment tagging support is not available or enabled.
- History
- Added in Bugzilla 5.0.
update_comment_tags¶
UNSTABLE
- Description
Adds or removes tags from a comment.
- REST
To update the tags comments attached to a comment:
PUT /rest/bug/comment/tags
The params to include in the PUT body as well as the returned data format, are the same as below.
- Params
comment_idRequiredintThe ID of the comment to update.
addarray of stringsThe tags to attach to the comment.
removearray of stringsThe tags to detach from the comment.
- Returns
Anarray of stringscontaining the comment’s updated tags.
- Errors
This method can throw all of the errors that get throws, plus:
- 125 (Comment Tagging Disabled)
Comment tagging support is not available or enabled.
- 126 (Invalid Comment Tag)
The comment tag provided was not valid (eg. contains invalid characters).
- 127 (Comment Tag Too Short)
The comment tag provided is shorter than the minimum length.
- 128 (Comment Tag Too Long)
The comment tag provided is longer than the maximum length.
- History
- Added in Bugzilla 5.0.
render_comment¶
UNSTABLE
- Description
Returns the HTML rendering of the provided comment text.
- Params
textRequiredstringsText comment text to render.
idintThe ID of the bug to render the comment against.
- Returns
htmlcontaining the HTML rendering.
- Errors
This method can throw all of the errors that get throws.
- History
- Added in Bugzilla 5.0.
This documentation undoubtedly has bugs; if you find some, please file them here.