Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Search question regarding an Operator

Harry Bob
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 29, 2020

Hey guys,

Trying to create a search which shows issues updated less than or equal to 5mins ago. 

 

issuetype in ("Reception - General Assistance TTP") and status in (Open) and updated <= 5m

 

Update <= 5m

------ means 'updated' time is less than or equal to 5mins, is that correct?

 

Please help me understand why my search is also showing issues that are older than 5mins

 

TTP-100 was last updated 23mins a go so it shouldn't show on my filter? What am I missing?

Snip20200529_811.png

Snip20200529_812.png

1 answer

1 accepted

1 vote
Answer accepted
Olga Videc
Community Champion
June 1, 2020

Hello @Harry Bob 

This works updated >= -5m

Trick till you learn this ;)

GO to issue navigator (search for issues) -> choose more > issue updated -> choose what you need there -> switch to advanced and there you will see JQL for this, copy it and add to desired JQL

BR, Olga

Harry Bob
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.
June 1, 2020

Hi @Olga Videc 

 

Thank you! This is great!! I was just going though it and the way jira uses operators is not what I am use to. Ive had a lot of headache trying to figure this out.

Harry Bob
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.
June 1, 2020

Hi @Olga Videc 

 

I think I'm on the verge of solving my problem! Would you be able explain how these ranges work?

I believe this will show issues within 3-4 days? Is there a way for me to narrow it down as much as possible to just 3?

 

I tried -3d to -3d but it didn't like that

Snip20200602_829.png

Olga Videc
Community Champion
June 2, 2020

Hello @Harry Bob 

Just one question you want issues created 72h ago from now 

OR

3 days ago by date, for example, today is June 2, 2020, you want to find all issues created on May 30, 2020

BR, Olga

Harry Bob
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.
June 2, 2020

Hey @Olga Videc ,

 

Would you mind showing me both? The more ways I know how to do things the better.

 

Do you know if there is details documentation on how to use operators properly? I have read through https://support.atlassian.com/jira-software-cloud/docs/advanced-search-reference-jql-operators/

 

But it doesn't explain how I would use BEFORE / AFTER in slightly more advance searches or even webinar?

I've been struggling to get my head around this so I appreciate your help. Its helped me move closer to what I need to do.

 

Thank you

Olga Videc
Community Champion
June 2, 2020

Part 1:

To find issues created more than 72h ago use created <= -72h 

Created more than 72h ago and 24h before that use 

    created >= -96h AND created <= -72h  

To explain this 

The first part finds all issues created in last 96h (equal 4 days) and the second part adds a limitation that issues needed to be created more than 72h ago.

So you take a 96h pool and using AND + condition 72h ago you are limiting this pool to issues that were created between 72 and  96 hours.

 

Part 2:

To find issues related to date 

We need to use startOfDay() function because it starts counting backward from midnight when you use in range -4 to - 3d its translated like "find all issues created more than 72h and less than -96h ago but from now", example now is 11:00 am it will search 11:00 am - 72h and more than -96h.

But when you use startOfDay it calculates today's midnight 00:00 - 72h and more than -96h

Documentation here 

https://support.atlassian.com/jira-software-cloud/docs/advanced-search-reference-jql-functions/#Advancedsearching-functionsreference-startOfDay

 

This was a tricky one but here it is:

Today is June 2, 3 days ago should be May 30 

To find issues created May 30 we need to need to break it down a but things we know

- those issues were created more than 2 days and less than 3 full days

We know that issues created more than 3 days ago are referenced as created <= -2d and issues created less than 3 days ago are referenced as created >= -3d

 

//If you are not sure you can get this ranges trough jira navigator

created <= -2d is presented as more than 2 days

created >= -3d is presented as within last 3 days

 

Solution:

Issues created exactly 3 days ago 

We add this to our startOfDay function we get this 

created <= startOfDay(-2d) AND created >= startOfDay(-3d)

 

Check this documentation you can use a lot more than startOfDay

 https://support.atlassian.com/jira-software-cloud/docs/advanced-search-reference-jql-functions/#Advancedsearching-functionsreference-startOfDay

 

Part 3:

Before means previous to; earlier or sooner than: 

IF you are searching status was Done before "2020/06/01"  you are searching all issues that were in status Done before June 01, May 31, May 30 and so on, in short everything older than that date

 

After means later in time than; in succession to

Same example 

Just the opposite from before, if you are searching after was Done before "2020/06/01" you are searching for everything that happened after Jun 1, that is Jun 2 etc...

 

Sorry for long explanation and if I'm repeating myself i just wanted to explain

BR, Olga

Like Harry Bob likes this
Harry Bob
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.
June 2, 2020

Thank you @Olga Videc 

 

This is so detailed which is fantastic! Appreciate the time taken to explain :) Don't need to be sorry this is great for me to learn!

Suggest an answer

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

Atlassian Community Events