Hey folks,
we used a macro showing the description and the name of all spaces with a certain category which has to be inserted in the macro as parameter.
We have added all needed actions to the cataina_opts parameter and checked the logfile for missing allowlist entries and added them as well to the according environment parameter but the macro isn´t showing any results. Has anyone a hint, whats wrong with it?
## Macro title: List spaces from category
## Macro has a body: N
##
## Adapted from several answers at https://community.atlassian.com/t5/Confluence-questions/Show-a-Space-List-within-a-page-using-Category-label/qaq-p/149585
## Date created: 19/02/2021
## @param CategoryLabel:title=Space Category|type=string|required=true|desc=The category you want to list spaces from.
## @param CategoryHeading:title=Heading|type=string|required=false|desc=Heading of first column in result table.
## try to get space category
#set ($spaceLabel = "projects")
## check if space category exists
#if ($!spaceLabel)
## try to get spaces by category
#set ($spaces = $action.labelManager.getSpacesWithLabel($spaceLabel))
## sort spaces alphabetically with bubble sort - takes n^2 passes
#set ($outerCnt = -1)
#foreach ($outerSpace in $spaces)
#set ($outerCnt = $outerCnt + 1)
#if ($outerCnt < $spaces.size()) ##Preventing bad array access
#set ($innerCnt = -1)
#foreach ($innerSpace in $spaces)
#set ($innerCnt = $innerCnt + 1)
#if ($innerCnt < $spaces.size()) ##Preventing bad array access
## Compare this and previous. If this is smaller, swap
#if ($innerSpace.name.compareToIgnoreCase($spaces.get($outerCnt).name) > 0 )
#set ($tmp = $spaces.get($outerCnt))
#set ($outerSpace = $spaces.set($outerCnt, $innerSpace))
#set ($outerSpace = $spaces.set($innerCnt, $tmp))
#end
#end
#end
#end
#end
<table>
<tr>
#if (${paramCategoryHeading})
<th>${paramCategoryHeading}</th>
#else
<th>Bereich</th>
#end
<th>Beschreibung</th>
</tr>
#foreach ($space in $spaces)
## check if current user can view space
#if ($permissionHelper.canView($action.remoteUser, $space))
#set ($spaceDescription = $space.getDescription())
<tr>
<td><a href="$!space.urlPath">$!space.name</a></td>
<td>$spaceDescription.getBodyAsString()</td>
</tr>
#end
#end
</table>
#else
<div class="aui-message warning">
<p class="title">
<span class="aui-icon icon-warning">Warning</span>
<strong>Space category not found</strong>
</p>
<p>Couldn't find space category <strong>$paramLabel</strong>!</p>
</div>
#end
many thanks for any help!
regards
Hendrik