It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

JIRA User Directories API

Hi,

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
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Posted 5 hours ago in Industry Groups

Upcoming Team Tour Government Symposium in Washington D.C.

Calling all Community members from the Washington D.C. area! Atlassian’s Team Tour is heading to your city to host a Government Symposium on May 1st. Join our team and other government agencies to le...

10 views 0 1
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