Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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,555,526
Community Members
 
Community Events
184
Community Groups

What JQL filter syntax is best for a couple of conditions?

Phil Bustin
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.
May 19, 2023

I have the following working Filter, but I'd like to know if there is a better way to specify multiple statuses; a status with parentheses in its name, and the condition [date field] = today. 

I thought there might be a more compact construct for the IN condition than the one I used, and a less arcane syntax for the date field = today condition than -0d.   

In order to get the filter to work, I changed the name of the status containing parentheses from "Approval (PR Tasks)" to "Approval - PR Tasks".

Working filter

project in (TAST6, PIN, "INT") AND issuetype = "Dev Story" AND (status = "Waiting for PR Move" or status = "Selecting PR Tasks" or status = "Approval - PR Tasks") AND "PR Move Req Date" = -0d order by "Create Date" ASC

 

2 answers

1 accepted

2 votes
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 19, 2023

Hello @Phil Bustin 

For multiple status values use the IN operator. Example:

status in ("Waiting for PR Move", "Selecting PR Tasks")

 

If the statuses you want to check all belong to the same Status Category, and you want all statuses that are in that Status Category, then you could use the Status Category instead. Example: to get all issues that have a blue status (which is a status that is a member of the "In Progress" Status Category)

statusCategory = "In Progress"

 

To search for a status that has parentheses in the name simply enclose the status name in quotes.

status in ("status (with parens)")

To check for a date field against the current date you can use startOfDay(). Example

"PR Move Req Date" > startOfDay()
Phil Bustin
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.
May 22, 2023 • edited

Thank you. 

However, "PR Move Req Date" > startOfDay() yielded two issues whose PR Move Req Date values = May 26, 2023. 

 

Filter

Filter with startOfDay().jpg

 

Result: Issue with PR Move Req Date May 26th

Issue with PR Move Req Date less than today.jpg

 

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 22, 2023

I'm sorry, my answer was incomplete.

If you want to get only the issues where the date field is set to today you need to use both "startOfDay()" and "endOfDay()".

"PR Move Req Date" > startOfDay() and "PR Move Req Date" < endOfDay()
Phil Bustin
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.
May 22, 2023

Thank you; that worked.

for current date, you can use "now" keyword.

EDIT:

My mistake, to use current date, make use of "startOfDay()" function.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events