Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal


  • Give kudos
  • Received
  • Given


  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

user macro with CQL result (unlimited)

l had view "" and used the contentbylabel macro.

But max result of contentbylabel macro is 500.
I wanna more cql search result.

Do you have any idea?

I used this code.

## @param CQL:title=CQL Query|type=string|required=true|default=type = page and |desc=Enter CQL Query here, use pageId() to refer to current page ID and spaceKey() to refer to current space key.
## @param STARTDATE:title=StartDate|type=string|required=true|desc=From Date.
## @param ENDDATE:title=EndDate|type=string|required=true|desc=To date

#set ( $day1 = $paramSTARTDATE )
#set ( $day2 = $paramENDDATE )

#set ( $cql = $paramCQL.replace("pageId()", $"spaceKey()", $space.key) )
#set ( $cql = $cql +' and created >= "' + $day1 + '" and created <= "' + $day2 +'"' )
#set ( $htmlString = $action.getHelper().renderConfluenceMacro("{contentbylabel:showLabels=false|showSpace=false|max=1000|cql=$cql}") )

#set ( $results = 0)

#foreach ( $linkPart in $htmlString.split('href="') )
#set ( $results = $results +1 )
<p> $day1 ~ $day2 Found $results results.</p>


1 answer

1 accepted

0 votes
Answer accepted
Dario B Atlassian Team Aug 23, 2019

Hello @KRAFTON Inc_ ,

As mentioned in the Content By Label macro page, the max results limit is indeed set to 500 and there is no way to increase it.

However, I can see that in a previous community post another user pasted the code to create a user macro that returns the full list of results:


Please review above thread and let us know if it helps.



Thank you Dario!

Like Dario B likes this
Dario B Atlassian Team Nov 13, 2019

You are very welcome! :) 

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Confluence

What do you think is the most *delightful* Confluence feature? Comment for a prize!

- Create your own custom emoji 🔥 - "Shake for Feedback" on mobile 📱 - An endless supply of GIFs via GIPHY 🤩 Is there anything quite as nice as a pleasant surprise? Comment below with what...

402 views 23 8
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you