We want to create statistics based on labels. The statistics should only refer to one space. Is there a user macro for this?
Here is the link to this question: https://community.atlassian.com/t5/Confluence-questions/How-to-get-the-amount-of-pages-with-a-certain-label-in-Conflunce/qaq-p/295325
The only solution - user macro.
Thanks but the user macro under this link doesn't work. Does anyone knows an other user macro?
## @param Label:title=Label|type=string|required=true|desc=Please enter a label to count## @param Spaces:title=Space|type=string|required=false|desc=Separate each item with a comma or single space. Example: SPACEKEY,@personal. Blank means all spaces.#set ( $containerManagerClass=$content.class.forName('com.atlassian.spring.container.ContainerManager') )#set ( $getInstanceMethod=$containerManagerClass.getDeclaredMethod('getInstance',null) )#set ( $containerManager=$getInstanceMethod.invoke(null,null) )#set ( $containerContext=$containerManager.containerContext )#set ( $labelManager = $containerContext.getComponent('labelManager') )#set ( $requestedLabel = $labelManager.getLabel($paramLabel) )#set ( $spaceManager = $containerContext.getComponent('spaceManager') )#set ( $requestedSpace = $spaceManager.getSpace($paramSpaces) )#set ($labelinspace = $labelManager.getLabelsByDetail($requestedLabel,null,$requestedSpace,null))#if ( $labelinspace )$labelManager.getContentCount($labelinspace)#else0#end
Does anyone know, where is the mistake?
It looks like you're new here. Sign in or register to get started.