From 6490ad0f5f6de2e5ebf0e6028a14615c3fe51231 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Sat, 26 May 2007 06:03:33 +0000 Subject: [PATCH] =?utf8?q?Bug=20381737:=20Unable=20to=20get=20legal=20valu?= =?utf8?q?es=20of=20custom=20fields=20via=20XML-RPC=20-=20Patch=20by=20Fr?= =?utf8?q?=C3=83=C2=A9d=C3=83=C2=A9ric=20Buclin=20=20r/?= =?utf8?q?a=3Dmkanat?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Bugzilla/WebService/Bug.pm | 2 ++ contrib/bz_webservice_demo.pl | 19 ++++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm index a632ffaf09..a2710c4824 100755 --- a/Bugzilla/WebService/Bug.pm +++ b/Bugzilla/WebService/Bug.pm @@ -130,6 +130,8 @@ sub legal_values { my @custom_select = Bugzilla->get_fields({ type => FIELD_TYPE_SINGLE_SELECT }); + # We only want field names. + @custom_select = map {$_->name} @custom_select; my $values; if (grep($_ eq $field, GLOBAL_SELECT_FIELDS, @custom_select)) { diff --git a/contrib/bz_webservice_demo.pl b/contrib/bz_webservice_demo.pl index aa92d1dd99..d21405d4ad 100755 --- a/contrib/bz_webservice_demo.pl +++ b/contrib/bz_webservice_demo.pl @@ -49,6 +49,7 @@ my $Bugzilla_remember; my $bug_id; my $product_name; my $create_file_name; +my $legal_field_values; GetOptions('help|h|?' => \$help, 'uri=s' => \$Bugzilla_uri, @@ -57,7 +58,8 @@ GetOptions('help|h|?' => \$help, 'rememberlogin!' => \$Bugzilla_remember, 'bug_id:s' => \$bug_id, 'product_name:s' => \$product_name, - 'create:s' => \$create_file_name + 'create:s' => \$create_file_name, + 'field:s' => \$legal_field_values ) or pod2usage({'-verbose' => 0, '-exitval' => 1}); =head1 OPTIONS @@ -269,6 +271,21 @@ if ($create_file_name) { } +=head2 Getting Legal Field Values + +Call C with the name of the field (including custom +select fields). The call will return a reference to an array with the +list of legal values for this field. + +=cut + +if ($legal_field_values) { + $soapresult = $proxy->call('Bug.legal_values', {field => $legal_field_values} ); + _die_on_fault($soapresult); + $result = $soapresult->result; + + print join("\n", @{$result->{values}}) . "\n"; +} =head1 NOTES -- 2.47.2