Unable to get legal values of custom fields via XML-RPC

RESOLVED FIXED in Bugzilla 3.0

Status

()

Bugzilla
WebService
RESOLVED FIXED
10 years ago
10 years ago

People

(Reporter: Paolo Galati, Assigned: Frédéric Buclin)

Tracking

Bugzilla 3.0
Bug Flags:
approval +
approval3.0 +
blocking3.0.1 +

Details

Attachments

(3 attachments, 1 obsolete attachment)

(Reporter)

Description

10 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; it; rv:1.8.1.3) Gecko/20070514 Firefox/2.0.0.3
Build Identifier: Bugzilla version 3.0 stable

Calling legal_values() from Bugzilla::Webservice::Bug API passing custom field name (cf_browser_ver) result in an error like this:

<Fault 108: "Can't use cf_browser_ver as a field name.">

Reproducible: Always



Expected Results:  
Expecting list of actual values of custom field
(Assignee)

Updated

10 years ago
Version: unspecified → 3.0

Comment 1

10 years ago
Yeah, this was originally intentional, but I think we should allow it for 3.0.1.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Target Milestone: --- → Bugzilla 3.0
(Reporter)

Comment 2

10 years ago
But is a strange behavior, the code below taken from Bug.pm

    my @custom_select =
        Bugzilla->get_fields({ type => FIELD_TYPE_SINGLE_SELECT });

seems to get exactly custom fields from database, but subsequent line return false.

    grep($_ eq $field, GLOBAL_SELECT_FIELDS, @custom_select)


for this reason i thought this was a bug.
(Reporter)

Comment 3

10 years ago
Created attachment 265950 [details] [diff] [review]
patch to Bug.pm module for custom fields not returned via xmlrpc

Hi All
in attach my actual solution waiting for 3.0.1

Kind regards

Comment 4

10 years ago
Comment on attachment 265950 [details] [diff] [review]
patch to Bug.pm module for custom fields not returned via xmlrpc

These are objects, not hashes. All we need to do is to do a map { $_->name } @custom_select.
Attachment #265950 - Flags: review-

Comment 5

10 years ago
This is now a blocker, since this was supposed to work in 3.0.
Flags: blocking3.0.1+
(Reporter)

Comment 6

10 years ago
(In reply to comment #4)
> (From update of attachment 265950 [details] [diff] [review])
> These are objects, not hashes. All we need to do is to do a map { $_->name }
> @custom_select.
> 

Yes, but i am not so good in programming perl, my scripting language are python and ruby, i just find the simplest solution based on my poor perl knowledge.

best regards.
(Assignee)

Comment 7

10 years ago
Created attachment 266142 [details] [diff] [review]
patch, v1
Assignee: webservice → LpSolit
Attachment #265950 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #266142 - Flags: review?(mkanat)

Updated

10 years ago
Attachment #266142 - Flags: review?(mkanat) → review+

Updated

10 years ago
Flags: approval3.0+
Flags: approval+
(Assignee)

Comment 8

10 years ago
Created attachment 266146 [details] [diff] [review]
fix for bz_webservice_demo.pl to get legal field values, v1
Attachment #266146 - Flags: review?(mkanat)

Comment 9

10 years ago
Comment on attachment 266146 [details] [diff] [review]
fix for bz_webservice_demo.pl to get legal field values, v1

>+    print "$_\n" foreach (@{$result->{values}});

  Just do a join(). Otherwise this is fine. :-)
Attachment #266146 - Flags: review?(mkanat) → review+
(Assignee)

Comment 10

10 years ago
tip:

Checking in Bugzilla/WebService/Bug.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/WebService/Bug.pm,v  <--  Bug.pm
new revision: 1.5; previous revision: 1.4
done
Checking in contrib/bz_webservice_demo.pl;
/cvsroot/mozilla/webtools/bugzilla/contrib/bz_webservice_demo.pl,v  <--  bz_webservice_demo.pl
new revision: 1.8; previous revision: 1.7
done


3.0:

Checking in Bugzilla/WebService/Bug.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/WebService/Bug.pm,v  <--  Bug.pm
new revision: 1.4.2.1; previous revision: 1.4
done
Checking in contrib/bz_webservice_demo.pl;
/cvsroot/mozilla/webtools/bugzilla/contrib/bz_webservice_demo.pl,v  <--  bz_webservice_demo.pl
new revision: 1.7.2.1; previous revision: 1.7
done
Status: ASSIGNED → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
Summary: Unable to get custom fields via xmlrpc → Unable to get legal values of custom fields via XML-RPC
(Assignee)

Comment 11

10 years ago
Created attachment 266178 [details] [diff] [review]
POD for the --field option of bz_webservice_demo.pl

I forgot to include POD for the --field attribute. Here is the patch I checked in.

tip:

Checking in contrib/bz_webservice_demo.pl;
/cvsroot/mozilla/webtools/bugzilla/contrib/bz_webservice_demo.pl,v  <--  bz_webservice_demo.pl
new revision: 1.9; previous revision: 1.8
done

3.0:

Checking in contrib/bz_webservice_demo.pl;
/cvsroot/mozilla/webtools/bugzilla/contrib/bz_webservice_demo.pl,v  <--  bz_webservice_demo.pl
new revision: 1.7.2.2; previous revision: 1.7.2.1
done
Attachment #266178 - Flags: review+
You need to log in before you can comment on or make changes to this bug.