JQL query for updated comments is not working correctly

Our Forge app relies on the following JQL query jql=updated>${lastScannedByCurrentFullScanIssueUpdateTime} order by updated asc
lastScannedByCurrentFullScanIssueUpdateTime - holds a numeric value for updated time of the last processed issue, so each time we want to find issues that were not processed yet. We want to fetch issues by batches using this query in REST API for searching issues: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-search/#api-rest-api-3-search-get.

It works well for the cases of updating summary, description of an issue and creating a comment. However, when we update a comment and try to process the issues we get wrong issues fetched, particularly, we get issue where updated == ${lastScannedByCurrentFullScanIssueUpdateTime}.

I couldn’t find any related topic in Atlassian Developer Community or information in the documentation.

Well, your query uses >, which is “greater than”, so if updated == ${lastScannedByCurrentFullScanIssueUpdateTime} it will not match that issue.
Maybe you just want to use >=?

Yes, my expectation was also that issue with updated == ${lastScannedByCurrentFullScanIssueUpdateTime} shouldn’t have been fetched.
However, this is not the case when we are updating a comment under the issue. I have checked this using REST API, also checked using Jira user interface itself using the same JQL query for All issues.

To reproduce this problem you can update a comment of any issue and then get the updated time of that issue and convert this Date string update time to millis (the number of milliseconds for this date since the epoch). Then applying updated > ${updatedTimeOfIssueInMillis} will return the same issue, even though updated == ${updatedTimeOfIssueInMillis} holds true.

At this point, this seems like a bug, because this condition works correctly for other cases, e.g. updating summary, description of an issue or creating comment under an issue.

Oh ok, got it.
Yeah, the updated field isn’t always… updated: there are some issue fields that do not dispatch an “Issue updated” event. Finding a complete list is not trivial, but definitely editing comments, creating subtasks etc… work that way.
If I remember correctly, there are also a bunch of custom fields from JSM that – at least on Jira DC – do not trigger an update event, if you happen to be on DC, you can check the DefaultIssueUpdater class, if you’re on Cloud… well, only Atlassian will know :slight_smile:

1 Like

Also, I’ve already asked the same question in JQL query issue for updated comments. Updated field in issue is changed after comment updated but for some reason not correctly, for details, see JQL query issue for updated comments. Also I’ve provided some videos there for better understanding. Could you please watch them to see where exactly is a problem?

Here are videos where problem is reproduced
For an even better understanding could you please watch this video https://monosnap.com/file/RCBkdAX28wDYWn6WxkyrfrKSiiYqVU.

And this is how it works for summary and description https://monosnap.com/file/33Y02KMGUehFOkSjeaxxs5cv9YQ8HB i.e. it is similar to comment adding.