Edgewall Software
Modify

Opened 20 years ago

Closed 18 years ago

#1096 closed defect (worksforme)

Sort by severity is incorrect

Reported by: bryan@… Owned by: daniel
Priority: normal Milestone:
Component: report system Version: 0.8
Severity: normal Keywords:
Cc: bryan@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

When I create any report and sort by the 'Severity' column, they sort in the following order:

  • blocker
  • critical
  • enhancement ←- seems like this should be lower?
  • major
  • minor ←- should this be below 'normal'?
  • normal
  • trivial

They appear to be sorting in alpha order rather than severity order.

Attachments (1)

priorityseverity.jpg (14.0 KB ) - added by bryan@… 20 years ago.
Screenshot of mal-sorted priority/severity dropdowns.

Download all attachments as: .zip

Change History (5)

comment:1 by bryan@…, 20 years ago

After further experimentation we found that the priority column also sorts alphabetically (rather than higher priority first as we'd expect).

So we worked around it by adding 1/highest, 2/high and so on, then removing the original values, via trac-admin priority commands. We did the same for severity (using 1/blocker, 2/critical, and so on - note we had to use slashes because trac-admin apparently doesn't like dashes in values!). This allows our reports to properly sort by priority or severity.

This did lead to an odd little annoyance which we don't mind but thought we'd tell you about anyway: the dropdown boxes don't seem to sort correctly! I'm attaching a jpeg image showing the mis-sorted dropdown boxes.

by bryan@…, 20 years ago

Attachment: priorityseverity.jpg added

Screenshot of mal-sorted priority/severity dropdowns.

comment:2 by Christopher Lenz, 20 years ago

Component: generalreport system
Milestone: 0.9
Owner: changed from Jonas Borgström to daniel

How are you sorting by severity/priority? By clicking on the column headers, or by using an explicit ORDER BY in the report SQL?

comment:3 by anonymous, 20 years ago

Ack… memory is hazy. I am sure the problem manifested when clicking column headers. I am pretty sure I tried ORDER BY queries (and had same issue) but I am not certain. I can't replicate the problem now, because I prepended digits to the priority/severity levels to force proper sorting even if the sort is alphanumeric.

comment:4 by Matthew Good, 18 years ago

Resolution: worksforme
Status: newclosed

If you want to order your SQL query by priority you need to join on the "enum" table to get the numeric sortable order. This is done in the standard reports included with Trac, so you can use them as an example.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain daniel.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from daniel to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.