Bug 485777 - xmlrpc query() method does not handle bug_status correctly
xmlrpc query() method does not handle bug_status correctly
Product: Bugzilla
Classification: Community
Component: WebService (Show other bugs)
All Linux
low Severity medium (vote)
: ---
: ---
Assigned To: PnT DevOps Devs
Depends On:
  Show dependency treegraph
Reported: 2009-02-16 14:08 EST by Toshio Ernie Kuratomi
Modified: 2013-06-23 22:15 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-02-16 14:37:35 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Mozilla Foundation 478771 None None None Never

  None (edit)
Description Toshio Ernie Kuratomi 2009-02-16 14:08:21 EST
Description of problem:

When using the bugzilla xmlrpc query method via python-bugzilla, we're unable to query for the complete list of bugs that have a status other than CLOSED due to a bug in query() when listing all but one bug_status.

For instance, 'yum', has 1844 bugs total and 38 that are not closed but this query returns all 1844 bugs::

  import bugzilla
  bz = bugzilla.Bugzilla(url='https://bugzilla.redhat.com/xmlrpc.cgi')
  query = {'product': 'Fedora',
           'component': 'yum',
           'bug_status': ['ASSIGNED', 'NEW', 'NEEDINFO', 'MODIFIED',
               'ON_DEV', 'ON_QA', 'VERIFIED', 'FAILS_QA',
               'RELEASE_PENDING', 'POST'] }
  buglist = bz.query(query)

The strange thing is that if I remove *any* one of the statuses from bug_status, we get the proper bugs back.  (For instance, removing either 'RELEASE_PENDING' or 'POST' shows only 38 bugs; removing 'NEW' results in 11 bugs).
Comment 1 David Lawrence 2009-02-16 14:37:35 EST
This is a bug in Bugzilla that when it looks at your search criteria and more specifically the values you have entered for bug_status, it does a simple comparison to see how many statuses you provided and how many total statuses the system uses. So if they are equal, it assumes you want all bugs for any status so it drops that part from the search criteria.

The issue here is that NEEDINFO is not currently a valid bug state but by having it in the list it equals out to the same number of states the system uses. By substituting NEEDINFO with CLOSED you would have the right full status list.

So as a workaround this problem to get you going, simply drop NEEDINFO from your list and it should do what you need. That way your list is not equal to all of the statuses and it will not drop that part.


Note You need to log in before you can comment on or make changes to this bug.