Show closed Jira tickets as last

For some of my JIRA filters (and for JIRA lists on some of my Confluence pages) I need to display all closed JIRA tickets as last and all in progress in the beginning of list. Using ORDER BY status failed because Closed isn’t neither first nor last status name when ordering status names alphabetically.

Searching Internet also didn’t help, but I managed to find a cool workaround:

ORDER BY resolution DESC

It assumes that any JIRA ticket in progress has resolution set to Unresolved which in JIRA means “empty value” and causes all tickets with such resolution to be displayed first and all tickets with Resolution != Unresolved to be displayed as last.