Fix query patch - version, milestone sort ordering for grouping