Hi all, I’m new to the community, apologies if below question has been asked already and if so please can you point me in the right direction.
I am following Atlassian guidance here How to view a list of all space creators and administrators for all spaces | Confluence | Atlassian Documentation
I’m wondering if there is some way to modify this user macro code to get only the ‘active’ and ‘site/global’ spaces omitting personal and archived spaces from the list. This is for performance reasons and as mostly users are interested in ‘active’ and ‘site/global’ and not personal or archived spaces.
Any help would be greatly appreciated. Thanks
## Macro title: Space Administrators
## Macro has a body: N
## Body processing: Selected body processing option
## Output: Selected output option
##
## Developed by: Andrew Frayling (21/03/2012)
## Modified by: Foogie Sim (01/05/2013)
## Modified by: Mal Ninnes (19/03/2024)
## Installed by: <your name>
## Macro to display a list of space administrators for all spaces
## @noparams
#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($spaces = $spaceManager.getAllSpaces())
<table class="confluenceTable">
<tr>
<th class="confluenceTh">Space</th><th class="confluenceTh">Space Administrator</th>
</tr>
#foreach($spacer in $spaces)
<tr>
<td class="confluenceTd">$spacer.name</a></td>
<td class="confluenceTd">#set($admins=$spaceManager.getSpaceAdmins($spacer)) #foreach($admin in $admins) $admin.name, #end</td>
</tr>
#end
</table>