Closed Bug 381737 Opened 17 years ago Closed 17 years ago

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

Categories

(Bugzilla :: WebService, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 3.0

People

(Reporter: p.galati, Assigned: LpSolit)

Details

Attachments

(3 files, 1 obsolete file)

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
Version: unspecified → 3.0
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
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.
Hi All
in attach my actual solution waiting for 3.0.1

Kind regards
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-
This is now a blocker, since this was supposed to work in 3.0.
Flags: blocking3.0.1+
(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.
Attached patch patch, v1Splinter Review
Assignee: webservice → LpSolit
Attachment #265950 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #266142 - Flags: review?(mkanat)
Attachment #266142 - Flags: review?(mkanat) → review+
Flags: approval3.0+
Flags: approval+
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+
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
Closed: 17 years ago
Resolution: --- → FIXED
Summary: Unable to get custom fields via xmlrpc → Unable to get legal values of custom fields via XML-RPC
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.