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

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: List all pages by the lable and manipulate them


In my user macro I am trying to list all pages through my confluence for defined label and then manipulate them (for example, sort by name). 

I was searching through pageManager, but was not able to find what method can do it. Any ideas?


1 answer

1 vote
Dominic Lagger Community Leader Aug 21, 2020

Hi @Vladimir Vakhlov 

Here is an user macro which shows 10 pages of the label "test".

You get an list of ContentEntityObjects. You can try to sort the list.

#set( $label = $action.getLabelManager())
#set( $pageList = $label.getContentForLabel(0,10,$label.getLabel("test")).getList())

#foreach( $page in $pageList )

Hope this helps you

Regards, Dominic

Like Dominic Lagger likes this

Suggest an answer

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

Confluence Mythbusters: Does Atlassian even use Confluence?

Hi, Confluence collaborators! As part of #Confluence-Collaboratory month, we’ve created a very special Mythsbusters segment, where we're dive into an interesting myth and uncover the truth behind i...

1,407 views 7 29
Read article

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