How to use custom developed content property in cql?


I am trying to create content property for storing some value on page creation. I’m able to create it but not able to use it into cql functionality.

I’m referring this blog.:Powerful new search and property storage APIs in Confluence 5.7 - Atlassian Developer Blog

I have added following indexed schema in plugin.xml

<content-property-index-schema key=“myindex-schema-module-key”> <key property-key=“approval-plugin-data”> <extract path=“approver” type=“string” /> <extract path=“approval-date” type=“date” /> </key> </content-property-Preformatted textindex-schema>

And, adding property by following ways:

Content content = contentService.find().withId(ContentId.valueOf(“1234”)).fetchOneOrNull();
JsonContentProperty property = JsonContentProperty.builder()
.content(content) .key(“approval-plugin-data”) .value(new JsonString(“{“approver”:“mjones”, “approval-date”:“2015-01-24”}”)).build();

I was able to fetch the page content property using REST call.


It will show me page property whatever I added in java class.

but its not working inCQL.[approval-plugin-data].approval-date > now(-7d)

it returning no result found !!!



did you get this working?

  • Did you try to rebuild the search index? In General Configuration > Content Indexing

My question to you: How did you test this CQL statement. I’m using the REST Api but I get “Could not parse cql :…” - I’m URL-encoding the search string but no success

GET http://localhost:1990/confluence/rest/api/content/search?


1 Like