Using Between operator in JQL query

Zaki Ögmundsson May 2, 2022

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
Atlassian Team members are employees working across the company in a wide variety of roles.
May 2, 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
Zaki Ögmundsson May 4, 2022

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
Atlassian Team members are employees working across the company in a wide variety of roles.
May 4, 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.

Zaki Ögmundsson May 4, 2022

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