Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,293,371
Community Members
 
Community Events
165
Community Groups

Using Between operator in JQL query

Hi all,

I've got two JQL queries:

 

1.

createdDate > startOfMonth() and createdDate < endOfMonth()

 

2.

createdDate between startOfMonth() and endOfMonth()

 

Can someone explain to me why the former JQL query will run while the latter will not?

 

Thanks,

Zaki

1 answer

1 accepted

1 vote
Answer accepted
Filipi Lima Atlassian Team May 02, 2022

Hello, Zaki,

The way Jira implements the between is through the use of the dual notation, showing both the start and end threshold as you did on 1.

For example, if you apply this on Basic Search:

image.png

It gets translated into:

created >= 2022-05-01 AND created <= 2022-05-02

Hi Filipi,

I see. Does that mean that the Between operator can only be used for dates and not functions like startOfMonth()?

Filipi Lima Atlassian Team May 04, 2022

HI, Zaki,

Even though "between" is considered a keyword (this list is hardcoded) I could not find any implementation of it which means it won't work for date values either.

We have to stick to the implementation provided above - using a lower and an upper threshold separately.

I'll look a bit more if there's any application for "between" and will reply back if I find anything.

Hi Filipi,

 

Thank you for your help. I really appreciate it :)

I'll just keep in mind to use Between for dates and not for functions.

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you