Content by label not returning all results

Bob Childs July 2, 2018

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.

 

1 answer

1 vote
Daniel Eads
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 5, 2018

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

Bob Childs July 13, 2018

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.

Daniel Eads
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 17, 2018

Great investigation! Thanks for posting the solution.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events