JQL Function

How do we write a JQL function which will fetch the issues based on issues opened\created one day before. Ouq requirement is when the function runs on Monday it should extract data for Friday , Sat, Sun. When the same query is executed on Tuesday it should only pull data for Monday .

3 answers

1 accepted

You can achieve this with following query

(created > startOfDay(-1d) and created < startOfDay()) or (created >startOfDay(-3d) and created < startOfDay() and created < startOfWeek())

The first bracket contains all issues created the day before, the second is valid for all issues created in the last three days and before the week started. Note, depending where you are the week starts at different days (Some start with Monday some with Sunday). If Sunday is the first day use startofWeek(1d)

0 vote
Steven Behnke Community Champion Feb 24, 2015

This is a duplicate of https://answers.atlassian.com/questions/38644

Hmm, well I'm not sure you can pull Friday, Saturday, Sunday automatically but the easiest way to grab issues based on created date is so:

createdDate >= -1d
createdDate >= -72h

Or something of this nature.

Thaks Udo. It works.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,331 views 14 20
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot