Search code examples
pythonweb-servicesxml-rpcbugzilla

how to retrieve field values from python-bugzilla xml-rpc


I am using ”python-bugzilla 0.8.0” for xml-rpc web service of bugzilla 4.2.

Anyone knows how to retrieve field values. i.e. If bugzilla Severity field have following values: Critical, Significant, Medium, Uncritical etc. then how I can get these values via python code ?

getbugfields() method returns the names of the fields but how I could get the values of the fields ?

Thanks in advance,


Solution

  • Here is a reply from "redhat" (supplier of python-bugzilla tool) that

    "*there is no wrapper for what I want. The bugzilla XMLRPC call is 'fields' for bugzilla4+

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

    It can be a 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.*"