5.1.8. Bug Fields¶
The Bugzilla API for getting details about bug fields.
5.1.8.1. Fields¶
Get information about valid bug fields, including the lists of legal values for each field.
Request
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)
name |
type |
description |
---|---|---|
id_or_name |
mixed |
An integer field ID or string representing the field name. |
Response
{
"fields": [
{
"display_name": "Priority",
"name": "priority",
"type": 2,
"is_mandatory": false,
"value_field": null,
"values": [
{
"sortkey": 100,
"sort_key": 100,
"visibility_values": [],
"name": "P1"
},
{
"sort_key": 200,
"name": "P2",
"visibility_values": [],
"sortkey": 200
},
{
"sort_key": 300,
"visibility_values": [],
"name": "P3",
"sortkey": 300
},
{
"sort_key": 400,
"name": "P4",
"visibility_values": [],
"sortkey": 400
},
{
"name": "P5",
"visibility_values": [],
"sort_key": 500,
"sortkey": 500
}
],
"visibility_values": [],
"visibility_field": null,
"is_on_bug_entry": false,
"is_custom": false,
"id": 13
}
]
}
field
(array) Field objects each containing the following items:
name |
type |
description |
---|---|---|
id |
int |
An integer ID uniquely identifying this field in this installation only. |
type |
int |
The number of the fieldtype. The following values are defined:
|
is_custom |
boolean |
|
name |
string |
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_name |
string |
The name of the field, as it is shown in the user interface. |
is_mandatory |
boolean |
|
is_on_bug_entry |
boolean |
For custom fields, this is |
visibility_field |
string |
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 is |
visibility_values |
array |
This field is only shown when |
value_field |
string |
The name of the field that controls whether or not particular values of the field are shown in the user interface. Can be null. |
values |
array |
Objects representing the legal values for
select-type (drop-down and multiple-selection)
fields. This is also populated for the
|
Value object:
name |
type |
description |
---|---|---|
name |
string |
The actual value–this is what you would specify for
this field in |
sort_key |
int |
Values, when displayed in a list, are sorted first by this integer and then secondly by their name. |
visibility_values |
array |
If |
is_active |
boolean |
This 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. |
description |
string |
The description of the value. This item is only
included for the |
is_open |
boolean |
For |
can_change_to |
array |
For Each object contains the following items:
|
Errors
51 (Invalid Field Name or Id) You specified an invalid field name or id.
5.1.8.2. Legal Values¶
DEPRECATED Use ‘’Fields’’ instead.
Tells you what values are allowed for a particular field.
Request
To get information on the values for a field based on field name:
GET /rest/field/bug/(field)/values
To get information based on field name and a specific product:
GET /rest/field/bug/(field)/(product_id)/values
name |
type |
description |
---|---|---|
field |
string |
The name of the field you want information about. This should be the same as the name you would use in Create Bug, below. |
product_id |
int |
If you’re picking a product-specific field, you have to specify the ID of the product you want the values for. |
Response
{
"values": [
"P1",
"P2",
"P3",
"P4",
"P5"
]
}
name |
type |
description |
---|---|---|
values |
array |
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.
This documentation undoubtedly has bugs; if you find some, please file them here.