The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

User Macro not working after upgrade

Augustin Luton
October 16, 2023

Hello, 

Could you please help me on this code? 

This is a user macro which displays a table with all spaces and their administrators, whatever the current user's permission.

It does not work since upgrading from 7.13 to 7.19

Thanks a lot for your help!

 

<table class="confluenceTable">
<tr>
<th class="confluenceTh">Spaces</th>
<th class="confluenceTh">Admins</th>
</tr>

#foreach ( $space in $spaces )
#if((!($space.isArchived())) && ($space.isGlobal()))
<tr>
#set($result=$space.getDescription().getDescriptionTitle())

<td class="confluenceTd"><a href="$req.contextPath$space.getUrlPath()">$space.getName()</a></td>
<td class="confluenceTd">
#foreach ($permission in $space.getPermissions())
#if ($permission.isUserPermission() && $permission.getType() == "SETSPACEPERMISSIONS")
#usernameLink($permission.getUserName())<br>
#end
#end
</td>
</tr>
#end
#end
</table> 

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Augustin Luton
October 18, 2023

This error message is displayed when editing the user macro:

User Macro display-all-spaces may use context keys [ spaceManager, req ] which are not set in system property macro.required.velocity.context.keys. If the macro is not rendered as expected, try to manually add those keys into the system property.

DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events