Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JQL filter for multiple custom fields by months

Andrew Smith April 26, 2018

Hello,

I hope someone got answer on my question. I need to create filter with multiple custom fields or one custom field with different tabs and sorting by months.

For example I have done this filter:

project = XXX AND created >= 2018-04-01 AND created <= 2018-04-30 AND "Primary Root Cause" = "RC1 – Human Error Slip or Lapse (Unintentional)" OR "Primary Root Cause" = "RC6 - Third Party Human Error (Unintentional)"  ORDER BY updated DESC

Where is "Primary Root Cause" is custom field.

But my issue is because filter find much more dates instead of this range 2018-04-01 AND 2018-04-30.

This is working perfectly only if I use only one custom filed:

project = IG AND created >= 2018-04-01 AND created <= 2018-04-30 AND "Primary Root Cause" = "RC1 – Human Error Slip or Lapse (Unintentional)" ORDER BY updated DESC

 

I have been trying to replace "AND" to "OR" but this is still shows me more than date range.

 

Thank you

 

1 answer

1 vote
MoroSystems Support
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 26, 2018

Hello,

your query finds "Primary Root Cause" = "RC1 – Human Error Slip or Lapse (Unintentional)" into date range but "Primary Root Cause" = "RC6 - Third Party Human Error (Unintentional)" without date range because of OR operator precedence.

Add parentheses for adjust precedence. This query works fine:

project = XXX AND created >= 2018-04-01 AND created <= 2018-04-30 AND ("Primary Root Cause" = "RC1 – Human Error Slip or Lapse (Unintentional)" OR "Primary Root Cause" = "RC6 - Third Party Human Error (Unintentional)")  ORDER BY updated DESC

 

Greetings

Josef Pavelec

Suggest an answer

Log in or Sign up to answer