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
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. :-\
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I do the same, Trudy..."I wonder if I could create an automation rule for that..." :^)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your answers Trudy and Bill. Unfortunately both won't work for my case but they are good to know :)! Thanks again.
I observed the following in the json response for an issue:
"created": "2022-09-14T10:15:40.321-0500",
"updated": "2022-09-14T10:15:40.381-0500",
They just differ by milliseconds which makes me think the above fields are populated by calling the now() function in whatever language the implementation is in for both fields separately.
If both fields could be changed to contain same value then my life would have become much simpler! I tried creating a bug, but I do not have the required permissions or the support tier.
For now, I'll be moving away from this issue! Thanks again.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.