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

JQL search parameters to find date X business days from now

Eric Bergeron April 3, 2023

Hello, 
I have a scheduled automation running with a JQL search. I would like to find all tickets that have Custom-Date-Field = X business day from now. My long web search for a solution has not brought me any successful outcome. 

Something like: 
project = XYZ AND "ResponseDate[Date] =now.minusBusinessDays(5) 

The above does not work. Any idea how to type it correctly?

2 answers

1 accepted

2 votes
Answer accepted
Eric Bergeron April 4, 2023

I resolved my issue by reducing the efficiency of the JQL search on the in the Scheduled automation trigger, making it run a broader search. Then, I used an advanced field compare, which permits the use of the {{now.minusBusinessDays(5)}} smart value. 

1 vote
Riley Venable
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 3, 2023

1. Go to the Issue Navigator page in Jira.

2. Click on the 'Advanced' button to open the JQL search window.

3. In the search box, type in the following query: project = XYZ AND "Custom-Date-Field" = startOfWeek(-1d) Note: Replace XYZ with the name of your project and "Custom-Date-Field" with the name of the custom field you are searching for.

4. Edit the "startOfWeek" function in the query to match your requirements. In this example, the function is set to "-1d", which means last business day. You can change the value to the number of business days you want to go back from now. For example, if you want to go back 5 business days from now, you can change "-1d" to "-5d".

5. Click on the 'Search' button to execute the search. This JQL query should return all tickets that have a value of X business day from now in the Custom-Date-Field.

Eric Bergeron April 4, 2023

Hello @Riley Venable , 
thank you for having taken the time to respond. 

However, this does not fulfill the intended search. StartOfWeek() function will search X days in reference from the start of the week. If it's a monday, the formula will work, but if it's friday, a startOfWeek(-5d) will be looking back 8 business days, not 5. 

I need the formula to work on any given day of the week.

Suggest an answer

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

Atlassian Community Events