LDAP User List in User Macro

Is there a way to create a user macro that pulls in the list of users from LDAP and presents these in a drop-down list so the contributor can choose a single user from the list?

Essentially, I'm looking to create a macro that has all the users included, but only one can be selected. I'd really like it if the user selected was referenced with @user style as well. Is this possible?

1 answer

1 accepted

0 vote
David Simpson Community Champion Jun 13, 2013

You'd have to write something bespoke to return everything from an LDAP. @mentions could work instead if you know the person's name.

For a user macro that essentially reproduces @mentions try this:

## Macro title: User Mention

## @param UserName:title=User|type=username|required=true|desc=Type a user's name

#set($displayName = $userAccessor.getUser($paramUserName).getDisplayName())
<a class="confluence-userlink user-mention" data-username="${paramUserName}" href="/display/~${paramUserName}" data-linked-resource-type="userinfo" data-base-url="{baseUrl}" title="$displayName" data-user-hover-bound="true">$displayName</a>

The User parameter autocompletes on user name/display name because it is of type username.

It produces the exact same display style as @mentions

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Published 12 hours ago in Confluence

Think you know shares vs. @mentions in Confluence? Take this collab quiz.

To anyone who doubts that Atlassians are a little too obsessed with collaboration, and tools related thereto, let me describe a recent discussion we had (which took place on our internal Confluence, ...

95 views 2 4
Read article

Atlassian User Groups

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!

Find my local user group

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

Groups near you