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) len(buglist) 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).
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. Dave