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

Connection to ActiveDirectory with script console



We are trying to connect to our AD forest from the script console, to ultimately able to use the same code with Behaviors or a scripted field. 

Anyway, we want to avoid copying Jars and the like, and we use groovyldap in the console, like this:

@GrabResolver(name='apache-snapshot', root='')
@Grab(group='', module='groovyldap', version='0.1-SNAPSHOT')


def lda_server = 'ldap://,DC=xx,DC=xx'
def ldap_user = 'xxx'
def ldap_password = 'xxxxxx'
def ldap = LDAP.newInstance(lda_server, ldap_user, ldap_password)
def result = ldap.searchUnique("cn=xxxx");
ldap.eachEntry ('(&(OU=xxxx,OU=xxxx))') { person ->
println "${person.displayName} (${})"

But sadly, we get an error 52e, and according to Atlassian doc, it means invalid credentials. But those credentials are valid when I query AD with ADBrowser.

groovyldap don't specify which auth mechanism it use, so maybe it`s using something else than simple? When using JNDI instead of grooyldap, we get this error:

javax.naming.NoInitialContextException: Cannot instantiate class: Root exception is java.lang.ClassNotFoundException:
at javax.naming.spi.NamingManager.getInitialContext(

Jira Server 7.11.

1 answer

0 votes

Pascal were you ever able to figure this out? Thanks

Suggest an answer

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

Upcoming changes to epic fields in company-managed projects

👋 Hi there Jira Community! A few months ago we shared with you plans around renaming epics in your company-managed projects. As part of these changes, we highlighted upcoming changes to epics on...

14,479 views 37 44
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you