This commit addresses where wrong "primary" field was used to indicate Ticket Status column. It also fixes an issue where sorting was done via `id` instead of `name`.