It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Creating a JIRA query to find tasks where the due date is within 7 days of the tickets creation

Howdy Folks,

 

I want to be able to isolate tickets created in Jira where the creation date of the ticket is within 7 days of the due date. I tried a couple of different queries for this that did not appear to work, so I thought I would see what the experts here might be able to suggest.

 

Thanks,

R

1 answer

0 votes

Hi @The Rebelminion - I don't think you will be able to run a plain JQL to bring the result-set you are looking for. We are not trying to pull tickets with a relative timing criteria here, like - tickets that are due in less than 7 days from now, or tickets created in the last 7 days and are due today, or something similar. 

Since you are looking at all the tickets (open/unresolved or otherwise, let's assume) that have a due date within 7 days of their created date, it means you are trying to find the days between two dates, and seeing if this is <= 7 days.

One way to handle this is to have a custom calculated field that stores the number of days between created and due date, and querying this would give us what we are looking for.

The other is to look at marketplace apps. Are you open to looking at apps? If you are, try scripted fields from ScriptRunner (https://scriptrunner.adaptavist.com/5.0.4/jira/scripted-fields.html) 

Here are some references from the past community posts -

https://community.atlassian.com/t5/Jira-questions/Calculate-days-between-dates/qaq-p/229273

https://community.atlassian.com/t5/Jira-questions/Subtracting-dates-in-Jira/qaq-p/142874

Hope this helps!

-kalyani

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira

The add-in you’ve been waiting for: Jira Cloud for Excel 🙌

Introducing Jira Cloud for Excel Here at the product integrations team at Atlassian, we are thrilled to announce the new Jira Cloud for Excel add-in! This add-in lets you export Jira data directly ...

882 views 7 24
Read article

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