[python-bugzilla] Fwd: Complex Query Support

Mildred Clarke gargoyle.python at gmail.com
Wed Nov 12 17:37:08 UTC 2014


Thanks for the reply on this issue. I've tried the "bugzilla" command line
with --from-url option and the results are basically the same. At this
point it looks like I will need to perform the advanced query from the Web
UI, export the result set to CSV file, then import into my script for
processing which is not ideal. It's workable, but not ideal.

Can anyone think of a better option / workaround to obtain an "advanced
query" result set ?

Thanks

MC

On Wed, Nov 12, 2014 at 8:18 AM, Cole Robinson <crobinso at redhat.com> wrote:

> On 11/12/2014 11:12 AM, Mildred Clarke wrote:
>
>> All,
>>
>> The python-bugzilla implementation is great but I have one issue that I
>> cannot
>> seem to find resolution on. Was hoping that someone here could shed some
>> light
>> on the situation. I have attempted a few different ways and upon review
>> of the
>> source I don't think* what I am attempting to do is supported in the
>> version I
>> am using (1.1.0)
>>
>> When I attempt to build a complex query, the url_to_query method returns a
>> dictionary object that appears to contain the appropriate values. However,
>> when attempting to query the remote bugzilla instance an error message is
>> displayed and no results are returned.  I believe this is due to the use
>> of
>> the "advanced" query format. The error message is complaining about the
>> use of
>> "v1" and sometimes "o2". Is it the use of Regex ? Is it my bugzilla
>> instance ?
>>
>> Message and code snips below.
>>
>> --- Error Message ---
>> Fault: <Fault 53: 'v1 is not a valid parameter for the
>> Bugzilla::Bug::match
>> function.'>
>>
>> --- Error Message ---
>> Fault: <Fault 53: 'o2 is not a valid parameter for the
>> Bugzilla::Bug::match
>> function.'>
>>
>>
>> --- CODE SNIP ---
>> q_url="https://bugzilla.local/query.cgi?bug_status=New&bug_
>> status=Accepted&bug_status=Reopened&f1=cf_custom_field_
>> here&f2=bug_id&f3=alias&o1=regexp&o2=greaterthan&o3=
>> notsubstring&query_format=advanced&v1=^%24&v2=410000&v3=-"
>>
>> Returns the values in a dictionary with this command --
>> bz.url_to_query(q_url)
>>
>> {'bug_status': ['New', 'Accepted', 'Reopened'],
>>   'f1': 'cf_custom_field_here',
>>   'f2': 'bug_id',
>>   'f3': 'alias',
>>   'o1': 'regexp',
>>   'o2': 'greaterthan',
>>   'o3': 'notsubstring',
>>   'query_format': 'advanced',
>>   'v1': '^$',
>>   'v2': '410000',
>>   'v3': '-'}
>>
>> This is the actual code that will produce the error message. bz is my
>> bugzilla
>> connection.
>> """ bz.query(bz.url_to_query(q_url)) """. As you can see, I am using the
>> "advanced" formatting.  If I don't include the "f*, v*, o*" parameters
>> queries
>> return a result set.
>>
>> Let me know if you need more details to help figure out this issue.
>>
>> Thanks
>>
>> Mildred.
>>
>
> The query_format=advanced support is a bugzilla.redhat.com custom
> extension, so probably doesn't work for your local bugzilla instance. There
> was some talk at one point of extending upstream bugzilla to support
> something similar, but AFAICT that doesn't exist yet.
>
> - Cole
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.fedorahosted.org/pipermail/python-bugzilla/attachments/20141112/2bca028a/attachment-0001.html>


More information about the python-bugzilla mailing list