Opened 17 years ago
Closed 17 years ago
#5747 closed defect (worksforme)
strange ticket grouping in custom report
Reported by: | Owned by: | Jonas Borgström | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | ticket system | Version: | devel |
Severity: | minor | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
I have slightly modified the 7th default report "My Tickets" in the following way to make it work with my customized workflow :
SELECT p.value AS __color__, (CASE status WHEN 'accepted' THEN 'Accepté' WHEN 'info_given' THEN 'Retour information' WHEN 'info_needed' THEN 'Demande info' WHEN 'in_process' THEN 'En cours' WHEN 'waiting_for_verification' THEN 'En attente de validation' ELSE 'Assigné' END) AS __group__, id AS ticket, summary, component, version, milestone, t.type AS type, priority, time AS created, changetime AS _changetime, description AS _description, reporter AS _reporter FROM ticket t LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority' WHERE t.status NOT IN ('closed') AND owner = $USER ORDER BY p.value, milestone, t.type, time
Unless I have misread the query, the report should group the results only by status.
But the report seems to also group by priority. So that, for instance, I have a group named "En attente de validation" which contains some tickets, whose priority value is "crticial", and further in the report I see another group "En attente de validation" in which tickets' priority value is "major".
Is this just my query which is wrong, or is this a real defect? (not a big issue, but it's somewhat confusing)
I'm using r5856.
Attachments (0)
Change History (2)
comment:1 by , 17 years ago
comment:2 by , 17 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
I got it !
Actually, the ORDER BY clause takes precedence over the whole 'AS __group__
' thing.
So in order to make my report work like I want it to, I must order by status before ordering by priority.
It sounds logical in the end, but it wasn't obvious.
you do not have multiple 'waiting_for_verification' entries, isn't it?