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.
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.
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.
Jira JQL does not natively support comparing date fields against each other. There is a change request for that.
It can also be done if you add Adaptavist Scriptrunner to your instance.
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.