Custom Filter sort with conditional logic

Dom Cotton June 13, 2019

This relates to Jira Service Desk.

I have a custom filter which is sorting by descending priority placing my highest at the top.  However if an item has a due date I want that to be first if its the same date as today - so i want to do something like this:

order by iif(duedate = today(), 99, priority) desc

 So the theory is that if its got a due date it will naturally be first, otherwise it would use priority order.  Does anybody know how to get something like this working?

Thanks

2 answers

0 votes
Eric Isaacs May 11, 2021

Sort by Due Date, then Priority Order is probably your best bet.

0 votes
Olga Videc
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 13, 2019

Hello @Dom Cotton 

This is an Else if statement and there is no equivalent for this in JQL.

The same thing is discussed here 

https://community.atlassian.com/t5/Jira-questions/How-to-Use-Conditional-Statements-in-Search-Filter/qaq-p/851838

Answer provided by Atlassian 

Natively, Jira can't do this kind of conditional searching in JQL.   It might be possible for you to use something like the SQL for Jira Driver: Convert JQL to SQL to help here.  This plugin lets you use more SQL like syntax when querying Jira.   

What I would do is add a custom filed type Select list, for example, I'll name it  "Priority Rank".

Then use automation to check due date, and if the due date is today set "Priority Rank"

Also, I would add automation to edit "Priority Rank" based on issue priority when created.

Of curse, you would need Automation for Jira plugin to achieve this.

OR 

Add two gadgets with filter results to your dashboard one to represent due day issues and other issues ordered by priority. 

No plugin no, done in a few minutes.

BR, Olga

Suggest an answer

Log in or Sign up to answer