The default bug view has changed. See this FAQ.

the "creation_time" parameter to Bug.search incorrectly uses the "equals" operator

RESOLVED FIXED

Status

()

bugzilla.mozilla.org
API
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: glob, Assigned: glob)

Tracking

Production
x86
Mac OS X

Details

(Assignee)

Description

4 years ago
+++ This bug was initially created as a clone of Bug #916979 +++

I'm using json-rpc interface to access Bugzilla API. It seems that the "creation_time" parameters don't work;

https://bugzilla.mozilla.org/jsonrpc.cgi?method=Bug.search&params=[{"limit":3,"product":"Firefox","component":"Untriaged","status":"UNCONFIRMED","include_fields":["creation_time","id","status","summary","last_change_time" ]}]

and the "creation_time" doesn't return anything:

https://bugzilla.mozilla.org/jsonrpc.cgi?method=Bug.search&params=[{"limit":3,"creation_time":"2011-07-09T17:56:00Z","product":"Firefox","component":"Untriaged","status":"UNCONFIRMED","include_fields":["creation_time","id","status","summary","last_change_time" ]}]
(Assignee)

Comment 1

4 years ago
the documentation for the creation_time parameter has:
> Searches for bugs that were created at this time or later

however the code uses the "equals" operator - it should use "greaterthaneq", so the results returned are incorrect.
Assignee: nobody → webservice
Component: API → WebService
Product: bugzilla.mozilla.org → Bugzilla
QA Contact: default-qa
Summary: parameter "creation_time" in Bug.search doesn't work → the "creation_time" parameter to Bug.search incorrectly uses the "equals" operator
Target Milestone: --- → Bugzilla 5.0
Version: Production → 4.5
(Assignee)

Comment 2

4 years ago
oops -- looks like upstream has the correct operators, but not the bmo backport.  moving back.
Assignee: webservice → nobody
Component: WebService → API
Product: Bugzilla → bugzilla.mozilla.org
QA Contact: default-qa
Target Milestone: Bugzilla 5.0 → ---
Version: 4.5 → Production
(Assignee)

Comment 3

4 years ago
Committing to: bzr+ssh://bjones%40mozilla.com@bzr.mozilla.org/bmo/4.2/
modified Bugzilla/WebService/Bug.pm
Committed revision 9007.
Assignee: nobody → glob
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
(In reply to Byron Jones ‹:glob› from comment #2)
> oops -- looks like upstream has the correct operators, but not the bmo
> backport.  moving back.

My bad. Fixed on BMO and made a note to file an upstream bug as this parameter can cause long running queries. For example try:

/rest/bug?creation_time=1970-01-01

Equals made more sense to mitigate the possible misuse of the query. Will file an upstream bug now.

dkl
(In reply to David Lawrence [:dkl] from comment #4)
> (In reply to Byron Jones ‹:glob› from comment #2)
> > oops -- looks like upstream has the correct operators, but not the bmo
> > backport.  moving back.
> 
> My bad. Fixed on BMO and made a note to file an upstream bug as this
> parameter can cause long running queries. For example try:
> 
> /rest/bug?creation_time=1970-01-01
> 
> Equals made more sense to mitigate the possible misuse of the query. Will
> file an upstream bug now.
> 
> dkl

Ok realize that the proper fix is to limit the number of search results return to API calls which the default currently is 10000 so the admin will know what they are doing if they change that.

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