Bug 1013483 - XMLRPC and web search with same query yields different results
XMLRPC and web search with same query yields different results
Product: Bugzilla
Classification: Community
Component: WebService (Show other bugs)
Unspecified Unspecified
high Severity high (vote)
: ---
: ---
Assigned To: PnT DevOps Devs
Depends On:
  Show dependency treegraph
Reported: 2013-09-30 04:10 EDT by Alexander Todorov
Modified: 2013-10-01 00:07 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-10-01 00:07:16 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Alexander Todorov 2013-09-30 04:10:00 EDT
Description of problem:

Filing here, although I'm not sure if this is strictly a bug or a feature. 

I have a script which uses python-bugzilla to run queries between two particular dates. When running from the script it gives 50 bugs, while when run manually from the webUI it yields 35. 

The query is:
classification=Red Hat&component=anaconda&component=parted&component=pykickstart&component=pyparted&f1=bug_status&f2=bug_status&f3=bug_status&list_id=1753757&o1=changedafter&o2=changedbefore&o3=changedto&product=Red Hat Enterprise Linux 5&query_format=advanced&v1=2013-01-08&v2=2013-10-01&v3=CLOSED

When run from a script some of the offending bugs are:

All they have in common is that they were closed by Errata Tool after release (5.9 GA), status changed from RELEASE_PENDING to CLOSED/ERRATA. 

Last closed: 2013-01-07 23:05:19 
When: 2013-01-08 06:05:19 EET 

I suspect that one of the searches uses UTC while the other uses local time values. If this is the case, how do I make the script query based on UTC values?
Comment 1 Alexander Todorov 2013-09-30 10:19:32 EDT
See comment #0 for the query string for the manual bug search. When using python-bugzilla I use this snippet:

qd = {
    'query_format' : 'advanced',
    'chfieldfrom' : datetime(2013, 1, 8, 00, 00, 00),
    'chfieldto' : datetime(2013, 10, 1, 23, 59, 59),
    'chfield' : 'bug_status',
    'chfieldvalue' : 'CLOSED',
    'product' : 'Red Hat Enterprise Linux 5',
    'component' : ['anaconda', 'pykickstart', 'parted', 'pyparted'],

bugs = bz.query(qd)
Comment 2 Jason McDonald 2013-10-01 00:07:16 EDT
Currently, it's a feature.

Bugzilla's Web UI does not adjust for the user's timezone and performs its searches using the server time (US/Eastern, UTC-4 during DST, UTC-5 the rest of the year).

If you want to query via the Web UI using UTC, you will need to include hours and minutes values to the query to convert UTC to server time (and adjust for DST).  For example, the query from comment #0 can be changed to:


(Note the difference for applying DST to the second date but not the first.)

Note also that the search in comment #1 presumably used your local time (EET?) rather than UTC, so your script would also have to adjust for UTC to be guaranteed to produce the same set of search results.

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