You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.
View groupJoin the community to find out what other Atlassian users are discussing, debating and creating.
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 -> template.search("", "(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: 5.7.0.1-p5
Hi,
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
import javax.naming.directory.SearchControls
import javax.naming.directory.Attributes
def cnList = LdapUtil.withTemplate('corporate') { template ->
template.search("", "(sn=Smi*)", SearchControls.SUBTREE_SCOPE, { Attributes attributes ->
attributes.get('cn').get()
} 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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello
But where can I download com.onresolve.scriptrunner.ldap.LdapUtil ? There no any jars on https://mvnrepository.com/maven
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
There is no need to download and import `LdapUtil` separately: it is part of the regular ScriptRunner installation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
G’day everyone! Super exciting news coming from the Marketplace. We have now fully rolled out the ability for end-users to submit app requests to admins directly from within the product! No longer ...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.