[python-bugzilla] Making OR queries with python-bugzilla

Cole Robinson crobinso at redhat.com
Mon Oct 28 17:17:02 UTC 2013


On 10/23/2013 05:30 AM, Alexander Todorov wrote:
> Hi guys,
> passing this query disctionary to python bugzilla doesn't seem to work:
> 
> {
>         'j_top' : 'OR',
> 
>         'field0-0-0' : 'keywords',
>         'type0-0-0' : 'substring',
>         'value0-0-0' : 'FutureFeature',
> 
>         'field0-1-0' : 'short_desc',
>         'type0-1-0' : 'substring',
>         'value0-1-0' : 'RFE',
> }
> 
> 
> As far as I can see it will select BOTH bugs which have the FutureFeature
> keyword and Summary contains "RFE". While the webUI can select either of them.
> 
> Any ideas how do I make this with python-bugzilla?
> 

You probably need to pass add a dictionary entry for 'query_format' :
'advanced' so rhbz handles those URL value names.

If you have a working rhbz URL, simplest way to convert it to a dictionary is
to do:

bugzilla --debug query --from-url "<url>"

And grab the query dictionary from the debug output.

- Cole



More information about the python-bugzilla mailing list