Bug 1264787

Summary: Document the 'order' parameter of Bug.search
Product: [Community] Bugzilla Reporter: Tomas Hoger <thoger>
Component: DocumentationAssignee: Jeff Fearn 🐞 <jfearn>
Status: CLOSED CURRENTRELEASE QA Contact: Jeff Fearn 🐞 <jfearn>
Severity: low Docs Contact:
Priority: low    
Version: 4.4CC: dwysocha, khong, qgong, tdecacqu, xiawu
Target Milestone: ---Keywords: Regression
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.0.4-rh75 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-10-04 00:14:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Tomas Hoger 2015-09-21 08:40:33 UTC
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 12:37:23 UTC
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:
http://git.engineering.redhat.com/git/users/dwysocha/tools.git/tree/bin/seg-search-bz

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 12:48:17 UTC
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-25 03:27:43 UTC
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.

Comment 5 Jeff Fearn 🐞 2018-06-26 01:22:09 UTC
This bug has missed the BZ5 feature freeze and has been bumped to 5.x.

Comment 7 Jeff Fearn 🐞 2021-05-06 02:24:11 UTC
*** Bug 1956944 has been marked as a duplicate of this bug. ***

Comment 8 Jeff Fearn 🐞 2022-09-26 02:05:21 UTC
On QA sever:

1: Go to advanced search page, click menu ->Help->Page Help!
2: Click on '2.5.5. Sort Order' in docs menu

Doc explains order drop down on advanced search page and how to manually craft the order.

Comment 9 Jeff Fearn 🐞 2022-09-28 00:12:18 UTC
This fix has been deployed to stage Bugzilla for a short public testing phase.

https://bugzilla.stage.redhat.com

Comment 10 Jeff Fearn 🐞 2022-10-04 00:14:35 UTC
This change is now live. If there are any issues, do not reopen this bug. Instead, you should create a new bug and reference this bug.