Opened 20 years ago
Closed 18 years ago
#1096 closed defect (worksforme)
Sort by severity is incorrect
Reported by: | 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)
Change History (5)
comment:1 by , 20 years ago
by , 20 years ago
Attachment: | priorityseverity.jpg added |
---|
Screenshot of mal-sorted priority/severity dropdowns.
comment:2 by , 20 years ago
Component: | general → report system |
---|---|
Milestone: | 0.9 |
Owner: | changed from | to
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 , 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 , 18 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
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.
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.