-- ## 10: Current Tickets (Developer) ## -- -- -- * List all pending tickets by priority. -- * Color each row based on priority. -- * If a ticket has been accepted, a '*' is appended after the owner's name SELECT p.value AS __color__, t.milestone AS __group__, id AS ticket, summary, component, version, milestone, t.type AS type, (CASE status WHEN 'assigned' THEN owner||' *' ELSE owner END) AS owner, 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' LEFT JOIN ticket_custom pending ON (t.id = pending.ticket and pending.name = 'pending') WHERE pending.value = 0 AND (status IN ('new', 'reopened') OR (status IN ('assigned') AND owner = $USER)) ORDER BY (milestone IS NULL), milestone ASC, p.value, milestone, t.type, time