Access to "About Me" text in user macro
Asked by Manuel:

Hi everyone,

I would like to write a simple user macro quite similar to the built-in macro "User Profile".

The macro should have the input of type "username" and the output...

**User Full Name**

```
$action.getUserFullName($paramUser))
```

**User Profile Picture**

```
$userAccessor.getUserProfilePicture($userAccessor.getUserByName($paramUser)).getUriReference()
```

That went well..but how do I get access these pieces of information?:

1. the "About Me" text from the Profile
2. the Phone-Number from the Personal Information
3. and the position from the Company Information

Thank you in advance!

Beste regards  
Manuel


Answers:
author: Thomas Schlegel
body: Hi [@Manuel](/t5/user/viewprofilepage/user-id/2571195) ,

the macro from 2012 by [@Andreas Gounaris](/t5/user/viewprofilepage/user-id/2796670) is still working (I tried it just now) and returns exactly what you need. You can find it here:

<https://community.atlassian.com/t5/Jira-questions/How-do-I-get-the-quot-About-Me-quot-field-from-a-confluence-user/qaq-p/130078>

comments: author: andreasgounaris
body: I'm glad it still works, thanks [@Thomas Schlegel](/t5/user/viewprofilepage/user-id/781483) for mentioning!


author: Manuel
body: Hi [@Thomas Schlegel](/t5/user/viewprofilepage/user-id/781483) ,

Thank you for your reply. The description in the example you gave me is exactly what I was trying. I unserstand the logic of the code but apperently I'm stuck somewhere - maybe in the datatype I am handing over to the methods.

If I copy-paste the code of [@Andreas Gounaris](/t5/user/viewprofilepage/user-id/2216048) the out put looks like this:
> \<div\> \<b\>Website: \</b\> $userDetailsManager.getStringProperty($action.remoteUser, 'website') \</div\> \<div\> \<b\>Location: \</b\> $userDetailsManager.getStringProperty($action.remoteUser, 'location') \</div\> \<div\> \<b\>About Me: \</b\> \<div id="profile-about-me-content"\>$renderedAboutMe\</div\> \</div\>

An if I copy-paste the code of [@Stefan Baader](/t5/user/viewprofilepage/user-id/609464) the output looks like this
> \<b\>Profildaten von User $user.fullName ($user.name)\</b\> \<div\> \<b\>Website: \</b\> $userDetailsManager.getStringProperty($user, 'website') \</div\> \<div\> \<b\>Location: \</b\> $userDetailsManager.getStringProperty($user, 'location') \</div\> \<div\> \<b\>Position: \</b\> $userDetailsManager.getStringProperty($user, 'position') \</div\> \<div\> \<b\>Phone: \</b\> $userDetailsManager.getStringProperty($user, 'phone') \</div\> \<div\> \<b\>Department: \</b\> $userDetailsManager.getStringProperty($user, 'department') \</div\> \<div\> \<b\>confluence.user.profile.email: \</b\> $userDetailsManager.getStringProperty($user, 'email') \</div\> \<div\> \<b\>About Me: \</b\> $renderedAboutMe \</div\>

Please help me to find the link. I'm probably close. Even if I enter "\<...\>" instead of \&lt; and \&gt;

Thank you in advance!

Beste regards  
Manuel


author: Thomas Schlegel
body: this is the code of the macro as it is working for me:

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/81298i000D7E44FC039776/image-size/large?v=v2&px=999 "image.png")

```
## @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($userDetailsManager = $containerContext.getComponent('userDetailsManager'))
#set($personalInformationManager = $containerContext.getComponent('personalInformationManager'))
#set($wikiStyleRenderer = $containerContext.getComponent('wikiStyleRenderer'))

#set($pi = $personalInformationManager.getPersonalInformation($action.remoteUser))
#set($renderedAboutMe = $wikiStyleRenderer.convertWikiToXHtml($pi.toPageContext(), $pi.getBodyAsString()))

<div>
<b>$action.getText('confluence.user.profile.website'): </b>
$userDetailsManager.getStringProperty($action.remoteUser, 'website')
</div>
<div>
<b>$action.getText('confluence.user.profile.location'): </b>
$userDetailsManager.getStringProperty($action.remoteUser, 'location')
</div>
<div>
<b>$action.getText('personal.info'): </b>
<div id="profile-about-me-content">$renderedAboutMe</div>
</div>
```


author: Manuel
body: This looks quite familiar to me, though the result on the confluence page looks like..
> **Website:** $userDetailsManager.getStringProperty($action.remoteUser, 'website')  
> **Location:** $userDetailsManager.getStringProperty($action.remoteUser, 'location')  
> **About Me:**$renderedAboutMe

We use Confluence Server 7.2.0. Is it maybe some configuration that's making the problem?

Any ideas?


author: Thomas Schlegel
body: Most probably you have no data in these fields on your profile.


author: Manuel
body: No, I do. :-(


author: Thomas Schlegel
body: Hmm, I tried with Confluence 6.15.9 - we don't have Confluence 7 yet. Maybe this is not working with Confluence 7 anymore.


author: Manuel
body: It seems to be removed in 7.x.

<https://community.atlassian.com/t5/Confluence-questions/How-to-get-user-s-quot-About-Me-quot-section-content-after/qaq-p/1253248>


author: Thomas Schlegel
body: Same question in the developer Community:

<https://community.developer.atlassian.com/t/problem-to-get-about-me-information-from-user-details-after-confluence-7-update/35258>

Maybe someone will find an answer there.


Tags: confluence-server

server