Forums

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

User macro - get email address

HH
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 22, 2020

Hi I'm trying to get the email address of a user with a supplied username. I've been looking on here: https://docs.atlassian.com/atlassian-confluence/6.6.0/ 

But I haven't been able to find what I'm after. 

I'm able to get the users name and profile pic, but I'm stuck on email, so if anyone could point me in the right direction that would be great!

 

#set($displayName = $action.getUserFullName($paramUsername))
#set($userPic = $userAccessor.getUserProfilePicture($userAccessor.getUserByName($paramUsername)).getUriReference())

What I'm trying to do but this class doesn't exist :D
#set($email = $action.getEmail($paramUsername))

Thanks!

1 answer

1 accepted

2 votes
Answer accepted
Dominic Lagger
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 22, 2020

Hi @HH 

You are on the right track with the userAccessor:

$userAccessor.getUserByName('dominic.lagger').getFullName() <br>
$userAccessor.getUserByName('dominic.lagger').getEmail() <br>

 getUserByName gives you an ConfluenceUser. There ou can call getEmail()

Regards, Dominic

HH
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 23, 2020

That's great - thank you! 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events