Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

How do I get a list of all users and their profile details

In case any one wants to know ho to do this. I use a group parameter to narrow down the list.

## @param Group:title=Group|type=string|required=false|desc=Group
#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 ( $users = $userAccessor.getMembers($userAccessor.getGroup($paramGroup)))

<table>
	<tr>
		<th></th>
		<th>Users</th>
		<th>Email</th>
		<th>Phone</th>
		<th>Location</th>
		<th>Role</th>
		<th>Department</th>
		<th>About User</th>
	</tr>

#foreach ($user in $users)
	#set ( $userD = $userAccessor.getUserByName($user.name))
	#set ( $pi = $personalInformationManager.getPersonalInformation($user))
	#set ( $renderedAboutMe = $wikiStyleRenderer.convertWikiToXHtml($pi.toPageContext(), $pi.getBodyAsString()))

	#set ( $phone = $userDetailsManager.getStringProperty($userD, "phone"))
	#set ( $location = $userDetailsManager.getStringProperty($userD, 'location'))
	#set ( $position = $userDetailsManager.getStringProperty($userD, 'position'))
	#set ( $department = $userDetailsManager.getStringProperty($userD, 'department'))
	#set ( $profile_pic = $userAccessor.getUserProfilePicture($userD))
	#set ( $pic_src=$profile_pic.getDownloadPath())

	<tr>
		<td>
			<a class="confluence-userlink url fn" data-username="$user.name" href="    /display/~$user.name">
				<img style="width:40px; height:auto;" src="$pic_src" alt="$usr_nm" border="0" />
			</a><br/>
		</td>
		<td>Name: $user.fullName <br/>
		    Username: $user.name<br/>
		    <a style="font-size:12px;" href="$action.getGlobalSettings().getBaseUrl()/admin/users/edituser.action?username=$user.name" title="Edit User Details">Edit Details</a>
		</td>
		<td>$user.email</td>
		<td>$phone</td>
		<td>$location</td>
		<td>$position</td>
		<td>$department</td>
		<td>
    			$renderedAboutMe
		</td>
	</tr>
    ## Clears out latent Value at end of loop to stop value from being set on successive items if empty for user
	#set ( $renderedAboutMe = "")
	#set ( $phone = "" )
	#set ( $location = "")
	#set ( $position = "")
	#set ( $department = "")
#end
</table>

1 answer

0 votes
Fabio Racobaldo _Herzum_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Sep 27, 2023

Hi @Matthew Beda ,

this code could help you on that.

Fabio

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events