tag:help.lighthouseapp.com,2008-09-20:/discussions/suggestions/372-show-tickets-with-no-set-milestone-when-sorting-by-priorityLighthouse: Discussion 2012-06-29T22:10:49Ztag:help.lighthouseapp.com,2008-09-20:Comment/891022009-03-11T18:15:35Z2009-03-11T18:15:35ZShow tickets with no set milestone when sorting by priority<div><p>This also affects tickets assigned to undated milestones.</p></div>Colin Bartolometag:help.lighthouseapp.com,2008-09-20:Comment/891022009-03-11T22:54:48Z2009-03-11T22:54:48ZShow tickets with no set milestone when sorting by priority<div><p>Ah, that has to do with the way mysql orders due dates. If you
don't care about the database details, skip the rest of this
paragraph :) The old way used a sort list like
<code>tickets.milestone_due_on, tickets.priority,
tickets.updated_at desc</code>. I just changed it to
<code>COALESCE(tickets.milestone_due_on, '2069-01-01'),
tickets.priority, tickets.updated_at desc".freeze</code>. I'm not
totally happy with this solution, but it works for now.<br></p>
<p>At any rate, tickets without a milestone or with an unscheduled
milestone will appear at the bottom.</p>
<p>I've also added a new sort option for ticket searches. You can
now do <code>sort:ticket-priority</code> that completely disregards
milestones. There's also <code>sort:milestone-priority</code>,
which is the default <code>sort:priority</code>.</p></div>Ricktag:help.lighthouseapp.com,2008-09-20:Comment/891022009-03-11T22:57:56Z2009-03-11T22:57:56ZShow tickets with no set milestone when sorting by priority<div><p>Beautiful. Thanks!</p></div>Colin Bartolome