Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,367,490
Community Members
 
Community Events
168
Community Groups

JQL updated > 'some-date' returns even the newly created issues

Hi folks,

For the following endpoint:

/rest/api/3/search?fields=*all&jql= issuetype='Story' AND project=CIT AND updated > '2022-09-14 10:15' ORDER BY updated ASC

 

I am even getting newly created issues in the response. Is this the expected behavior?

 

This post - https://community.atlassian.com/t5/Jira-questions/What-does-quot-updated-quot-JQL-actually-cover/qaq-p/622585 - did not help.

 

Thanks,

Nikhil

2 answers

2 votes

Hi @Nikhil Nanjangud -- Welcome to the Atlassian Community!

As you note you already have a separate query for the created issues, you may add this to your update query:

AND created <= "some date"

That would restrict to only those issues changed after your date and created before that point in time.

Kind regards,
Bill

Sometimes I overlook the simple solution. :-\

Like Bill Sheboy likes this

I do the same, Trudy..."I wonder if I could create an automation rule for that..."  :^)

0 votes

Hello @Nikhil Nanjangud 

Welcome to the community.

Yes, this is expected behavior.

Creation of an issue sets both the Created and Updated timestamps for the issue.

Hi Trudy,

 

Thank you for the clarification. I was wondering if there was a way to distinguish between created and updated issues out of the box in jira search using jql? I am looking to get only updated issues and exclude the newly created ones because I have a separate use case for getting newly created issues greater than a certain date. Apart from forming a query like(off the top of my head) - 'where created < updated', is there any other way?

 

Any pointers would be much appreciated.

 

Thanks,

Nikhil

Hello Nikhil,

Jira JQL does not natively support comparing date fields against each other. There is a change request for that.

https://jira.atlassian.com/browse/JRACLOUD-20727

It can also be done if you add Adaptavist Scriptrunner to your instance.

https://scriptrunner-docs.connect.adaptavist.com/jiracloud/enhanced-search.html#_datecompare

The only method I can think of to make the distinction without an app is to use an Automation Rule to set a separate custom field when an issue is updated, and then add that to your filter criteria. Though the Updated timestamp is set during issue creation, the Automation Rule trigger for Issue Updated is not fired upon issue creation. So you could use an Automation Rule with that trigger to update a custom field when an issue is actually updated.

Suggest an answer

Log in or Sign up to answer