Hello,
I am using content by label to perform a CQL search for all pages that are drafts:
$action.getHelper().renderConfluenceMacro('{contentbylabel:cql=state="draft"}')
This returns almost all the pages that are drafts. Some are not being returned for some reason. I have verified this by doing a REST API search.
Why might this be happening, and is there an easier way to do a CQL/REST API search in a macro?
Thanks for the help.
Hi Bob,
It doesn't look like state is a documented field for CQL and I wasn't able to use it to query pages in Confluence 6.6 when trying it out. Are you utilizing a plugin like Comala Workflows which might be adding some extra info to the page, or could you point me at what you've referenced to try and use the state field?
While it doesn't specifically answer your question, I also found an open feature request that relates to what it sounds like you might be trying to accomplish: https://jira.atlassian.com/browse/CONFSERVER-35921
Thanks,
Daniel
Hi Daniel,
Thank you for your prompt reply and your interest in helping resolve this! I do use Comala Workflows and I was able to figure out a solution. Here is the macro call below:
$action.getHelper().renderConfluenceMacro('{contentbylabel:cql=label="review60" and state="draft"|max=500}'))
I learned that you need to specify the maximum parameter when your search returns over 15 results, which is the default amount. Else your search may be undefined.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Great investigation! Thanks for posting the solution.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.