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

How can I show statistics on labels used in one space in Confluence

Bob Do March 12, 2018

We want to create statistics based on labels. The statistics should only refer to one space. Is there a user macro for this?

2 answers

0 votes
Bob Do March 19, 2018
## @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)
#else
0
#end

Does anyone know, where is the mistake? 

0 votes
Dmitry Mironov
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 13, 2018
Bob Do March 15, 2018

Thanks but the user macro under this link doesn't work. Does anyone knows an other user macro?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events