Commit 08f04597 authored by Frank Becker's avatar Frank Becker Committed by Dave Lawrence

Bug 690879 - Webservice Bug.fields should include include keyword name and…

Bug 690879 - Webservice Bug.fields should include include keyword name and description as legal values r=dkl, a=LpSolit
parent 29416b9f
...@@ -104,7 +104,8 @@ sub fields { ...@@ -104,7 +104,8 @@ sub fields {
my (@values, $has_values); my (@values, $has_values);
if ( ($field->is_select and $field->name ne 'product') if ( ($field->is_select and $field->name ne 'product')
or grep($_ eq $field->name, PRODUCT_SPECIFIC_FIELDS)) or grep($_ eq $field->name, PRODUCT_SPECIFIC_FIELDS)
or $field->name eq 'keywords')
{ {
$has_values = 1; $has_values = 1;
@values = @{ $self->_legal_field_values({ field => $field }) }; @values = @{ $self->_legal_field_values({ field => $field }) };
...@@ -198,6 +199,15 @@ sub _legal_field_values { ...@@ -198,6 +199,15 @@ sub _legal_field_values {
} }
} }
elsif ($field_name eq 'keywords') {
my @legal_keywords = Bugzilla::Keyword->get_all;
foreach my $value (@legal_keywords) {
push (@result, {
name => $self->type('string', $value->name),
description => $self->type('string', $value->description),
});
}
}
else { else {
my @values = Bugzilla::Field::Choice->type($field)->get_all(); my @values = Bugzilla::Field::Choice->type($field)->get_all();
foreach my $value (@values) { foreach my $value (@values) {
...@@ -1100,7 +1110,7 @@ values of the field are shown in the user interface. Can be null. ...@@ -1100,7 +1110,7 @@ values of the field are shown in the user interface. Can be null.
This is an array of hashes, representing the legal values for This is an array of hashes, representing the legal values for
select-type (drop-down and multiple-selection) fields. This is also select-type (drop-down and multiple-selection) fields. This is also
populated for the C<component>, C<version>, and C<target_milestone> populated for the C<component>, C<version>, C<target_milestone>, and C<keywords>
fields, but not for the C<product> field (you must use fields, but not for the C<product> field (you must use
L<Product.get_accessible_products|Bugzilla::WebService::Product/get_accessible_products> L<Product.get_accessible_products|Bugzilla::WebService::Product/get_accessible_products>
for that. for that.
...@@ -1133,6 +1143,11 @@ if the C<value_field> is set to one of the values listed in this array. ...@@ -1133,6 +1143,11 @@ if the C<value_field> is set to one of the values listed in this array.
Note that for per-product fields, C<value_field> is set to C<'product'> Note that for per-product fields, C<value_field> is set to C<'product'>
and C<visibility_values> will reflect which product(s) this value appears in. and C<visibility_values> will reflect which product(s) this value appears in.
=item C<description>
C<string> The description of the value. This item is only included for the
C<keywords> field.
=item C<is_open> =item C<is_open>
C<boolean> For C<bug_status> values, determines whether this status C<boolean> For C<bug_status> values, determines whether this status
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment