Get currentUser in user Macro

Hello Community,

I want to create a user macro which mirrors the task report macro but sets the currently logged in user automatic as parameter, so basically its the taskreport macro but it gets dynamic for each user.

My problem is i habve no access to any user variable.

I created following debug macro:

## === User Context Debug ===



### Request ($req)

$req.remoteUser = $!req.remoteUser

$req.getRemoteUser() = $!req.getRemoteUser()

$req.userPrincipal.name = $!req.userPrincipal.name

$req.session['seraph_defaultauthenticator_user'] = $!req.session.getAttribute("seraph_defaultauthenticator_user")



### Context ($context)

$context.user = $!context.user

$context.user.name = $!context.user.name

$context.user.key = $!context.user.key

$context.remoteUser = $!context.remoteUser



### Action ($action)

$action.remoteUser = $!action.remoteUser

$action.getRemoteUser() = $!action.getRemoteUser()

$action.remoteUser.name = $!action.remoteUser.name

$action.authenticatedUser = $!action.authenticatedUser



### Authentication Context ($authenticationContext)

$authenticationContext.getLoggedInUser() = $!authenticationContext.getLoggedInUser()

$authenticationContext.user.name = $!authenticationContext.user.name



### Content ($content)

$content.lastModifier = $!content.lastModifier

$content.lastModifier.name = $!content.lastModifier.name

but none of the methods show any value except the $content.lastModifier shows the correct value but i need the curretnly logged in User not the last modifier of the page.

How can I reliably get the current user inside a Confluence User Macro (Data Center)?

What I’ve Tried

  • Checked all common Velocity variables (Request, Context, Action, Authentication) → no output

  • Added a JVM option in Tomcat to disable the Macro allowlist for testing:
    ”-Dconfluence.macros.allowlist.enabled=false”

Thank you for your help!

BR David

Edit: We have Refined for Confluence in use (not sure if thats rellevant)