I seem to have a lot of user macros that will search for different user information but one I am sorely missing is one that will print out a list of groups a user is in, specifically the current user. Would someone mind providing me with one as I am scratching my head at this one?
If anybody is interested, a very simple macro to print out a bulleted list of every group the current user is part of can be made with the following:
## @noparams #set ($groups = $userAccessor.getGroupNamesForUserName($action.remoteUser.name)) <ul> #foreach ($group in $groups) <li>$group</li> #end </ul>
The $userAccessor object is of type UserAccessor, and has a method called getGroupNamesForUserName(). You pass this a user name.
For the current user, this would be something like this (can't remember the exact syntax for getting current user):
Badges are a great way to show off community activity, whether you’re a newbie or a Champion.Learn more
An efficient enterprise content management system, or ECM, is a must-have for companies that create work online (cough cough, all companies). If content calendars, marketing plans, and bu...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs