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 STABLE, UNSTABLE, and EXPERIMENTAL.

Utility Functions

legal_values EXPERIMENTAL

Tells you what values are allowed for a particular field.

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.

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.

Bug Creation and Modification


Gets information about particular bugs in the database.


An 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.)


A hash containing a single element, bugs. This is an array of hashes. Each hash contains the following items:


int The numeric bug_id of this bug.


string The alias of this bug. If there is no alias or aliases are disabled in this Bugzilla, this will be an empty string.


string The summary of this bug.


dateTime When the bug was created.


dateTime When the bug was last changed.

internals UNSTABLE

A hash. The internals of a Bugzilla::Bug object. This is extremely unstable, and you should only rely on this if you absolutely have to. The structure of the hash may even change between point releases of Bugzilla.

100 (Invalid Bug Alias)

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.

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.


This allows you to create a new bug in Bugzilla. If you specify any invalid fields, they will be ignored. 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.


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 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 (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.
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.

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.

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)

Either you didn't specify a component, or the component you specified was invalid.

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.

108 (Invalid Field Name)

You specified a field that doesn't exist as an argument to this function.

504 (Invalid User)

Either the QA Contact, Assignee, or CC lists have some invalid user in them. The error message will have more details.

Error 108 is only thrown by this function in the 3.0 branch, starting with 3.0.9.
Before 3.0.4, parameters marked as Defaulted were actually Required, due to a bug in Bugzilla.