Forums

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

CQL BUG - has 'lastmodified' stopped working?

Anurag Gulati
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 13, 2020

lastmodified in CQL is not working!

I know I have edited several pages today, and confluence keeps only returning two images from june.

This used to work.

Has something changed?

 

****Query run******
cqlQuery":"type=page and space in ('SIS') and lastmodified >= \"2020/07/13 14:55\" and created<\"2020/07/13 14:55\""

***User detals*****
This is from a user (me) whose timezone is set to be UTC (user settings on confluence)
The pages I am getting back have lastModified as below:
*****page returned********
"lastModified":"2020-07-13T14:02:51.263Z"

Last modified is clearly < 14:55Z.

Why is this happening?

When I ran similar code (with dates appropriate for last month) the above CQL worked.

 

 

Further:

Input (last modified)Output pages last modified  
lastmodified >= "2020-07-13 14:02" 2020-07-13 13:542020-07-13 13:572020-07-13 14:02
lastmodified>="2020-07-13 14:55"2020-07-13 13:572020-07-13 14:02 

2 answers

0 votes
Diego
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 24, 2020

Hello @Anurag Gulati !

I tried to replicate the behavior you explained but was ultimately unable to. I edited an already existing page called “NEW EDITOR” and then performed the following CQL search:

atlassian.net/wiki/rest/api/content/search?cql=lastModified>="2020-07-24 15:25"%AND%created<2020-07-24 15:25"

Since I specified both date and time for the lastModified value, only this page came up in the results:

Screen Shot 2020-07-24 at 15.32.35.png

Would it be possible for you to try the following:

  1. Create a new page
  2. Publish it
  3. Edit it
  4. Create a CQL that looks only for the newly created page based on created and lastModified
  5. Check if the newly created page shows up

You can run this directly in your browser by typing the CQL after "atlassian.net/wiki/rest/api/content/search?" and using the % character where white spaces should be placed. Much like the example I gave above.

 

Let us hear from you!

Anurag Gulati
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 30, 2020

Hi Diego,

Thanks for this. I can validate this does *not* work for my case as I suspect a timezone conversion's happening somewhere.

According to the documentation, I should specify the time in the timezone of the user who is querying not the timezone of the confluence site (cloud/on premise)

 

Can I ask what's the timezone of the user you are using to query and the timezone of the confluence site?

0 votes
Sachin
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.
July 13, 2020

Hello @Anurag Gulati , I think I have faced this issue last week. I have simply entered a random text in the search and did a basic search first. Then I added Type "Pages" and Last Modified "24hrs" and it started working.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
AUG Leaders

Atlassian Community Events