I've got this piece of code to count pages with a certain label in a certain space
## To count labels
## @param Label:title=Label|type=string|required=true|desc=Enter a label to count.
## @param Spaces:title=Space|type=string|required=false|desc=This Key is case-sensitive. Only for use in one single space. Example: SPACEKEY
#set( $labelManager = $action.LabelManager )
#set( $labRef = $labelManager.getLabel($paramLabel) )
#set( $pages = $labelManager.getCurrentContentForLabelAndSpace($labRef, $paramSpaces) )
I would really like to filter on, multiple labels (in AND and OR) anyone knows how?
Any help is appreciated
I know the answer for the "AND", but not for the "OR"
#set( $list = $labelManager.getContentInSpaceForAllLabels(0, 10, $paramSpaces, $labRef, $labRef2))
With this statement, you get a list of all pages in the space with the labels from $labRef AND $labRef2. Because it's this type of parameter (Label... labels) you can add as much labels you want.
The only thing I can imagine for "OR" would be to search with CQL, but this is a bit tricky (Don't know how)
Phew, Atlassian Team 2021 blew by. With dozens of demos and a handful of keynotes, you may have missed some of the awesome Confluence Cloud sessions. Don't' worry, you can watch them all here or on Y...
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