Need help with JQL in finding issues that has been created 4 hours ago and no assignee Edited

Subjects says it all. 

Neeed help with JQL to find issues that were created 4 hours ago and yet no assignee yet. 

Am trying this query but not workin.

project = IT  AND assignee is EMPTY  and created > -4h

Your help is greatly appreciated. Thanks in advance. 

 

2 answers

0 votes

Your > is the wrong way around, it's saying "created in the last four hours".  I think you want "updated < -4h" - that will give you all unassigned issues that have not been updated (including created) recently.

Thanks Nic for the quick reply. Sorry I did not frame my request right. 

The ask is :

1) Need a JQL to list all the tickets that have been created 4 hours ago and no assignee

 

No, there's nothing wrong with your query.  The query is looking for issues that were created "before (now - 4 hours)", or in English "more than 4 hours ago".  That means *Everything* over 4 hours old.

I think the problem is that your question is not right.

When you say "Need a JQL to list all the tickets that have been created 4 hours ago and no assignee", you are not defining the time range usefully.

"created 4 hours ago" is not a range.  It's an absolute.  Let's say I create an issue at 16:32:04.  The only time "created 4 hours ago" is going to find it is when it is 20:32:04.  That's a window of one second where the query works.


Which I don't think is what you really want?  Could you give us what you are really looking for?  Explain "created 4 hours ago" in full?

Sure, I will try to be precice. Lets say a ticket IST-1 is created at 2 PM and is not assigned to anybody for more then 4 hours. At 6  PM or little after 6 PM, if I run the query, IST-1 should come up in search result because that ticket was created 4 hours ago and not assigned to any one. Does it make sense ?

 

To be more precise, I have a add-on that runs at intervals and I have to feed that add-on with the query to search and return the tickets that have been created 4 hours ago and not yet assigned.  Why 4 hours ? 4 hours is the SLA that somebody has to take take up that ticket. Nobody taking a taking a ticket and if it is beyond 4 hours,  the add-on would pick the ticket up and alert us. 

 

Hope am clear with my question :) .. Sorry if am adding more confusion 

No, that's fine, it is clear, thank you.  The extra background of the requirement (the "why I want this") is also helpful too!

My question came up because you said "am seeing the tickets from yesterday also for some reason".  That's correct, you will see them because they are over 4 hours old and not assigned to anyone.

Weird, I am using the query "project = ABC AND created >=  4h and assignee is EMPTY", for some reason not returning any tickets. I created a ticket at 10:10 AM and it is now 3:45 PM. Any reason why not returning from the search ?

 

Please see the original answer!  Check your use of > and <

Here is my final query. 

Ask : Search and return all the tickets that has been created 4 hours ago from the current time. Lets say a ticket has been created at ABC-1 at 9 AM, ABC-2 at 9. 30 AM, ABC-3 at 10 AM and if I run this query at say at 4 PM and imagine these tickets are not assigned, when I run the below query , should return ABC-1, ABC-2,ABC-3 . 

project = ABC  and updated < -4h and assignee is EMPTY and status != Closed.

Do you think it will work ?

Yes.  Your query says :

Project ABC, not closed, not assigned, and (the important bit) the last update was more than 4 hours ago

All three of your example issues are over 4 hours old, so they will be there.

Perfect,  thanks so much Nic.

 

0 votes

Hi Vihar,

I used the same query and got the results I expected.  I had a project (HELLO WORLD)  that had issues from days ago.  I created two new issues and ran the following:

project = HEL and assignee is empty and created > -4h

I verified the results by running

project = HEL and assignee is empty

The above returned all of my issues which was expected. 

At this point I would try re-indexing and retrying the query to see if you get different results.

Cheers,

Branden

Thanks Brandan for the quick reply. Sorry I did not frame my request right. 

The ask is :

1) Need a JQL to list all the tickets that have been created 4 hours ago and no assignee

Something wrong with my query. Am trying to get the tickets created 4 hours ago with no assignee and status not closed, am seeing the tickets from yesterday also for some reason. 

Below is the query

project = IT AND created < -4h and Status != Closed

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 ...

2,990 views 12 18
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