Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

LDAP Connection script on Script Runner Resources

I was able to successfully setup the ldap connection but when I tried to run the sample script:

import com.onresolve.scriptrunner.ldap.LdapUtil

def cnList = LdapUtil.withTemplate('corporate') {

template ->"", "(sn=Smi*)", SearchControls.SUBTREE_SCOPE, { attributes ->

          attributes.get('cn').get() } as AttributesMapper<String>)


I'm getting the error: Unable to resolve class AttributesMapper


Jira version 8.5.1

Script Runner version:

1 answer

1 accepted

1 vote
Answer accepted


It appears that the example code is missing some imports. In full, I believe it should be:

import com.onresolve.scriptrunner.ldap.LdapUtil
import org.springframework.ldap.core.AttributesMapper

def cnList = LdapUtil.withTemplate('corporate') { template ->"", "(sn=Smi*)", SearchControls.SUBTREE_SCOPE, { Attributes attributes ->
} as AttributesMapper<String>)

NB. Annotating the attributes parameter as being of type Attributes is only done to satisfy the static type checker: it can safely be left out without changing the way the code behaves at run time.

Kind regards,

Joanna Choules, Adaptavist Product Support

Thank you! works now.


But where can I download com.onresolve.scriptrunner.ldap.LdapUtil ? There no any jars on


There is no need to download and import `LdapUtil` separately: it is part of the regular ScriptRunner installation.

HI @Joanna Choules ,


I used the same code any Idea why am I getting

org.springframework.ldap.PartialResultException: Unprocessed Continuation Reference(s); nested exception is javax.naming.PartialResultException: Unprocessed Continuation Reference(s); remaining name ''







Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira

Online AMA this week: Your project management questions answered by Jira Design Lead James Rotanson

We know that great teams require amazing project management chops. It's no surprise that great teams who use Jira have strong project managers, effective workflows, and secrets that bring planning ...

190 views 1 6
Read article

Atlassian Community Events