Skip to content

Instantly share code, notes, and snippets.

@sousk
Created March 17, 2010 02:21
Show Gist options
  • Save sousk/334813 to your computer and use it in GitHub Desktop.
Save sousk/334813 to your computer and use it in GitHub Desktop.
Trac - custom query, all active tickets and mine first
SELECT p.value AS __color__,
(CASE owner
WHEN '$USER' THEN 'My Tickets'
ELSE 'Active Tickets'
END) AS __group__,
id AS ticket, summary, component, version, milestone, t.type AS type, severity,
(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, enum p
WHERE status IN ('new', 'assigned', 'reopened')
AND p.name = t.priority AND p.type = 'priority'
ORDER BY (owner = '$USER') DESC, p.value, milestone, severity, time
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment