Bug 1264787 - Document the 'order' parameter of Bug.search
Document the 'order' parameter of Bug.search
Status: NEW
Product: Bugzilla
Classification: Community
Component: WebService (Show other bugs)
Unspecified Unspecified
medium Severity low (vote)
: ---
: ---
Assigned To: PnT DevOps Devs
: Regression
Depends On:
  Show dependency treegraph
Reported: 2015-09-21 04:40 EDT by Tomas Hoger
Modified: 2016-06-29 22:43 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
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 Tomas Hoger 2015-09-21 04:40:33 EDT
Description of problem:

After the recent BZ upgrade that included migration form MySQL to PostgreSQL, the order in which Bug.search returns its results changed.  Before the upgrade, results were (afaics) effectively sorted by bug id.  After the upgrade, returned bugs do not seem to be sorted in any way.

Any scripts that previously relied on / benefited from the automatic sorting need to be adjusted.
Comment 2 Dave Wysochanski 2015-09-24 08:37:23 EDT
I was just about to file this bug!  I agree this probably is due to the upgrade this past weekend.

I have this dumb little cmdline script I use to search bugzilla:

After the upgrade, I no longer get sorted bug numbers but they seem to come out in random order.  This is significant since I usually look at the latest bug numbers to determine if the issue I'm investigating for a customer is one which has already been fixed in the RHEL component or not.  And I can't just search open bugs since the bug may be fixed but in a recent version.  I could make the search more sophisticated but for now it's a very simple too.

I use this on a weekly basis and I can't recall the output having unsorted bug numbers until this week when I noticed it.
Comment 3 Dave Wysochanski 2015-09-24 08:48:17 EDT
Ok I figured out what I needed now.  I just needed to add '&order=bug_id' to the query and I get sorted by bug_id output.
Comment 4 Jason McDonald 2015-09-24 23:27:43 EDT
On further investigation, the 'order' parameter can be passed to Bug.search also.  The value is a comma separated list of field names.  Using 'bug_id' works but 'id' does not.

The 'order' parameter seems to be completely undocumented.  We should rectify that.

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