Forums

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

User administration for jira/confluence

Padmasree P
Contributor
November 7, 2018

how do I get the list of local user and groups from Jira and confluence server. I need to get the list of local users and groups apart from LDAP ones

1 answer

0 votes
Grigory Salnikov
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.
November 8, 2018

Hi @Padmasree P!

Have a look at the answers to the similar question:

JIRA finding users for a given directory

I've tested the method provided by @Salim Morgan and it worked for our Confluence server, I've been able to distinguish between internal directory users and those from Jira directory:

lastlogin.jpg

Here's the macro itself:

## Macro title: Last Login
## Macro has a body: N
## Body processing: Selected body processing option
## Output: Selected output option
##
## Developed by: Andrew Frayling
## Modified by: Michael Seager [Atlassian Support]
## Mofified by: Salim Morgan (STCS, Riyadh)
## Date created: 11/02/2012
## Installed by: <your name>
## Macro to display the last login date of users who have access to the current space
## @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($loginManager = $containerContext.getComponent('loginManager'))
#set($users = $userAccessor.getUsers())


<table class="confluenceTable">
<tr>
<th class="confluenceTh">Count</th>
<th class="confluenceTh">User</th>
<th class="confluenceTh">Login Name</th>
<th class="confluenceTh">Last Successful Login</th>
<th class="confluenceTh">Directory</th>
</tr>

#set($count = 0)

#foreach($user in $users)
## list the last login date of users who can view the current space
#if ($permissionHelper.canView($user, $space))
#set($count = $count + 1)
<tr>
<td class="confluenceTd">$count</td>
<td class="confluenceTd">#usernameLink($user.name)</td>
<td class="confluenceTd">$user.name</td>
<td class="confluenceTd">$action.dateFormatter.formatDateTime($loginManager.getLoginInfo($user.name).lastSuccessfulLoginDate)</td>
<td class="confluenceTd">$user.directoryId</td>
#end
#end
</table>

Many thanks go to @Salim Morgan and @Andrew Frayling or @Andrew Frayling @Andrew Frayling (I'm sorry, I don't know which one of you guys is the actual author)

I understand that this is not a complete answer but I hope it helps you to move in the right direction.

Suggest an answer

Log in or Sign up to answer