-- ## 9: System tickets ## -- -- Show all system tickets, orderd by status, priority, time SELECT p.value AS __color__, (CASE status WHEN 'closed' THEN 'color: #777; background: #ddd; border-color: #ccc;' ELSE (CASE owner WHEN $USER THEN 'font-weight: bold' END) END) AS __style__, id AS ticket, summary, component, t.type AS type, owner, status, time AS created, changetime AS modified, description AS _description, reporter AS _reporter FROM ticket t LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority' WHERE component = 'System aspects' ORDER BY status DESC, CAST(p.value AS int), time