[python-bugzilla] retrieving field values

Cole Robinson crobinso at redhat.com
Fri Sep 27 13:11:07 UTC 2013


On 09/23/2013 10:29 AM, Khokhar cth wrote:
> Hi,
> 
> I am using ”python-bugzilla 0.8.0” for xml-rpc service of bugzilla 4.2.
> 
> Could you please guide me how to retrieve field values. i.e.
> 
> If bugzilla Severity field have following values: Critical, Significant,
> Medium, Uncritical etc. then how I can get the list of these values via python
> code ?
> 
> 
>  getbugfields() method returns the names of the fields but how I could get the
> values of the fields ?
> 

We don't have a wrapper for what you want. The bugzilla XMLRPC call is
'fields' for bugzilla4+

http://www.bugzilla.org/docs/4.4/en/html/api/Bugzilla/WebService/Bug.html#fields

You can work around this by accessing the xmlrpc proxy directly and handling
the calls yourself, ex:

import bugzilla
bz = bugzilla.Bugzilla(url="https://bugzilla.kernel.org")

print bz._proxy.Bug.fields({"names" : ["rep_platform"]})

Of course, that's not supported, so it could stop working on you one day, but
for personal scripts and stuff it's an alternative.

- Cole


More information about the python-bugzilla mailing list