Forums

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

CQL: Order by created

Kamal Iqlaas Ismail October 1, 2021

Hi , hope all in good time.

We are trying to sort this CQL by the created parameter as per below CQL.

type=page and created >= startOfMonth("-90d")

Referred to the docs, but got the error when compiling 

Could not parse cql

CQL that has been tried

type=page AND created >= startOfMonth("-90d") AND order by created

type=page AND created >= startOfMonth("-90d") asc

type=page order by created AND created >= startOfMonth("-90d")

(type=page order by created) AND (created >= startOfMonth("-90d")).

Any pointers we missed or we should look at?

Appreciate your response in advance!

1 answer

0 votes
Lee Wonnacott
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.
October 1, 2021

Hey Kamal! 

There doesn't appear to be anything wrong with your initial query but I am curious, where you are attempting to run this query? Are you using a third-party plugin? 

Kind Regards, 
Lee

Kamal Iqlaas Ismail October 1, 2021

Appreciate the response Lee!

We are attempting to run the query from our Golang app.

Any other info I should add?

Do let me know!

Lee Wonnacott
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.
October 1, 2021

Hmm, is the app making a call to the Confluence REST API or is it executing the query via one of Confluence's internal Java API's? 

Kamal Iqlaas Ismail October 1, 2021

@Lee Wonnacott , just confirmed with my colleague

We are making a call to the Confluence Rest API.

Hope this helps!

Lee Wonnacott
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.
October 1, 2021

I was able to get the CQL query working by making a REST call to the following:

 <base_url>/rest/api/content/search?cql=type=page+and+created+>=+startOfMonth("-90d")

 It might be worth trying the same query within a tool like Postman to check it's working as expected before testing it within your app! 

I hope you're able to get everything up and running! :D 

Like David Griffin likes this
Kamal Iqlaas Ismail October 1, 2021

Yes, I got that working too, but when you add the order by filter, for me the CQL did not work.

Yes, familiar with the Postman tool!

Appreciate the response @Lee Wonnacott !

 

Have a nice weekend!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events