JIRA User Directories API


can you point me what API (manager, helper, service, ...) use to manipulate with JIRA User Directories. I need:

1. List all User Directories configured in JIRA

2. Get user directory, test if user is belongs to specific directory.

3. For LDAP user directory read his schema settings for user, group, membership (information like object class, object filter, name attribute, ...)

4. Create and send some LDIF request.

1 answer

1 accepted

Here's a sample... there is probably better way of getting your point 2). For point 4), jira doesn't actually manage the ldap server, so I think that's outside the scope of jira itself...? But you can get the connection url and authentication details so you can use JNDI to update ldap, if configured with read/write access.

import com.atlassian.crowd.manager.directory.DirectoryManager

def directoryManager = ComponentManager.getComponentInstanceOfType(DirectoryManager.class)
def userUtil = componentManager.getUserUtil()

// point 1
def directories = directoryManager.findAllDirectories()
directories.each {dir ->
    // point 2
    log.debug userUtil.getUser("x")?.directoryId == dir.id

    // point 3
    log.debug dir.attributes

Hi Jamie, Can a directory id of a User be updated with SOAP? If so could you please share some information?

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted 12 hours ago in United States

Administrators Cleanup

Good morning, After a long weekend cleaning up, I am still in the cleanup mode 😊. I am curious to know: When do you feel the urgency to cleanup your Atlassian Tools? How many times do y...

16 views 0 0
View post

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