I am writing a user macro to get a list of pages with a specific label.
This is the code that I have written. But it does not return anything. Do you know what's wrong with the code? how can I use the labelManager in a user macro?
## Macro title: My Macro
## Macro has a body: Y or N
## Body processing: Selected body processing option
## Output: Selected output option
##
## Developed by: My Name
## Date created: dd/mm/yyyy
## Installed by: My Name
## This is an example macro
## @Param Label:title=Label|type=string|required=true|desc=Input one label
#set($containerManagerClass=$action.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($pages = $labelManager.getContentForLabel($labelManager.getLabel($paramLabel), 10))
<span>
#foreach( $page in $pages )
<span class="aui-label">$page.name</span>
#end