[python-bugzilla] Trying to query using boolean_query on status details

Eric Sammons elsammons at gmail.com
Thu Aug 15 19:25:28 UTC 2013


One step closer, having the correct product is always a good idea, -p 'Red
Hat Enterprise MRG'.  That being said, I have not verified that my query
works up to the point where I add the --boolean_query.  At this point it
fails and I suspect it is simply that I have not figured out the
appropriate naming and format for the advanced query.

--Eric


On Thu, Aug 15, 2013 at 2:56 PM, Eric Sammons <elsammons at gmail.com> wrote:

> correction to the above,
>
> bugzilla query -p 'Red Hat MRG' --boolean_query='status.changedto-MODIFIED'
>
> This will run, but will return no bugs, so feeling like I'm on the right
> track I continue to manipulate the boolean_query but no luck thus far.
>
> One example run:
>
> $ bugzilla --debug query -p 'Red Hat MRG' -c "perl-qpid, python-qpid,
> qpid-cpp, qpid-java, qpid-jca, qpid-proton, qpid-qmf, qpid-sdk, qpid-snmpd,
> qpid-tests, qpid-tools" -m 3.0 --boolean_query='changedto-ASSIGNED &
> changedfrom-MODIFIED'
> [14:55:11] INFO (bugzilla:1015) Connecting to
> https://bugzilla.redhat.com/xmlrpc.cgi
> [14:55:11] INFO (bugzilla:1018) Autodetecting Bugzilla type
> [14:55:11] INFO (__init__:98) Bugzilla v0.9.0 initializing
> [14:55:11] DEBUG (__init__:34) Detecting subclass for
> https://bugzilla.redhat.com/xmlrpc.cgi
> [14:55:11] INFO (__init__:41) Using RHBugzilla for URL containing
> bugzilla.redhat.com
> [14:55:11] DEBUG (base:355) Using
> cookiefile=/home/esammons/.bugzillacookies
> [14:55:11] INFO (__init__:113) Chose subclass RHBugzilla v0.1
> [14:55:11] INFO (bugzilla:1065) Using cookies in
> /home/esammons/.bugzillacookies for authentication
> [14:55:11] DEBUG (base:924) Calling query with: {'product': ['Red Hat
> MRG'], 'field0-1-0': 'changedfrom', 'query_format': 'advanced',
> 'type0-0-0': 'ASSIGNED', 'component': ['perl-qpid', ' python-qpid', '
> qpid-cpp', ' qpid-java', ' qpid-jca', ' qpid-proton', ' qpid-qmf', '
> qpid-sdk', ' qpid-snmpd', ' qpid-tests', ' qpid-tools'], 'value0-1-0': '&',
> 'include_fields': ['assigned_to', 'id', 'status', 'summary'],
> 'target_milestone': '3.0', 'type0-1-0': 'MODIFIED', 'field0-0-0':
> 'changedto'}
> [14:55:14] DEBUG (bugzilla:1140)
> Traceback (most recent call last):
>   File "/usr/bin/bugzilla", line 1130, in <module>
>     main()
>   File "/usr/bin/bugzilla", line 1095, in main
>     buglist = _do_query(bz, opt, parser)
>   File "/usr/bin/bugzilla", line 613, in _do_query
>     return bz.query(q)
>   File "/usr/lib/python2.7/site-packages/bugzilla/base.py", line 925, in
> query
>     r = self._query(query)
>   File "/usr/lib/python2.7/site-packages/bugzilla/base.py", line 915, in
> _query
>     return self._proxy.Bug.search(query)
>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1224, in __call__
>     return self.__send(self.__name, args)
>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1578, in __request
>     verbose=self.__verbose
>   File "/usr/lib/python2.7/site-packages/bugzilla/base.py", line 166, in
> request
>     return self.parse_response(stringio)
>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1473, in parse_response
>     return u.close()
>   File "/usr/lib64/python2.7/xmlrpclib.py", line 793, in close
>     raise Fault(**self._stack[0])
> Fault: <Fault 108: "Can't use changedfrom as a field name.">
>
> Server error: <Fault 108: "Can't use changedfrom as a field name.">
>
>
> I have tried status-changedfrom also with no luck.
>
> --Eric
>
>
> On Thu, Aug 15, 2013 at 2:20 PM, Eric Sammons <elsammons at gmail.com> wrote:
>
>> I'm trying to, for the first time, run a query using advanced query
>> options.  I have tested my query in the bugzilla search arena so I know
>> what results I'm expecting.  Two issues have come up trying to run the
>> search from the bugzilla command line.
>>
>> First, when I use URL option I get 0 results when I know I should get > 1.
>>
>> bugzilla query -u '
>> https://bugzilla.redhat.com/buglist.cgi?classification=Red%20Hat&component=perl-qpid&component=python-qpid&component=qpid-cpp&component=qpid-java&component=qpid-jca&component=qpid-proton&component=qpid-qmf&component=qpid-sdk&component=qpid-snmpd&component=qpid-tests&component=qpid-tools&f2=OP&f3=bug_status&f4=bug_status&f5=bug_status&f6=bug_status&f7=CP&j2=AND_G&j_top=OR&list_id=1622662&o3=changedafter&o4=changedbefore&o5=changedto&o6=changedfrom&product=Red%20Hat%20Enterprise%20MRG&query_format=advanced&target_milestone=3.0&v3=2013-04-01&v4=2013-08-01&v5=MODIFIED&v6=ASSIGNED
>> '
>>
>> When I use debug and verbose all seems well, 0 bugs returned - which is
>> wrong.
>>
>> Second, I have tried to use --boolean_query option; however, I have used
>> this option only for flag types in the past so for me this is new
>> territory.  Basically I'm trying to recreate the above query using
>> --boolean_query with no success.   An very short example of what I have
>> tried.
>>
>> bugzilla query -p 'Red Hat MRG' --boolean_type='status.changedto.MODIFIED'
>>
>> I'm sure the above is completely wrong, any suggestions are appreciated.
>>
>> Thanks!
>>
>> --
>> Eric L. Sammons                            e <esammons at redhat.com>lsammons
>> at gmail dot com
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.fedorahosted.org/pipermail/python-bugzilla/attachments/20130815/0b4b0711/attachment-0001.html>


More information about the python-bugzilla mailing list