Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

user details for macro


trying to find what parameters are available in user macros as below.

As in I just want the users firstname to show but cannot seem to get the syntax correct.

$   (works)
$action.remoteUser.FullName  (works)
$action.remoteUser.FirstName  (nothing)
$action.remoteUser.LastName  (nothing)


 is there any documentation showing this  data?



1 answer

1 vote

Here are some of the functions available to the Confluence User object:

Unfortunately, there's nothing available to pull the first name, as Confluence doesn't keep track of which part of the full name is a first name, middle name, or last name. However, you could assume that it is the first word of the full name string in most cases. Therefore you could use something like this:

#set ( $fullName = $action.remoteUser.fullName )
#for ( $word in $fullName.split(" ") )
#set ( $firstName = $word )

thank you Stephen

Use #foreach, not #for (source:

Since I'm using the user macro inline, I've skipped the <p> </p> bit.

This code works for me:

#set ( $fullName = $action.remoteUser.fullName )
#foreach ( $word in $fullName.split(" ") )
#set ( $firstName = $word )

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events