Script Runner -- checking if user is in crowd directory that uses ldap.

Hi,

Our Jira instance is integrated with an external crowd. The crowd instance has several directories -- one of them uses the Microsoft Active Directory connector.

Just to be clear -- our Jira connects to crowd via a single user directory.

Is there away in script runner to check if a username is one that uses the ldap connector in crowd from with Jira -- wasn't sure if the embedded crowd api could do that?

Tips appreciated.

2 answers

1 accepted

It sounds like you're trying to determine which directory in Crowd a user came from, from the perspective of an application connected to Crowd. If so, that will be difficult to impossible, as Crowd has "abstract away directory aggregation from applications" as one of its design goals.

Certainly if you were to work out a way of doing this, it's extremely likely that we won't ensure backwards compatibility with it (in fact, it's more likely to be treated as a bug).

yep - exactly. Thanks for the info/insight!

0 vote
Henning Tietgens Community Champion Feb 11, 2014

I think you can use these methods from package com.atlassian.crowd.embedded.api:

  • User.getDirectoryId()
  • CrowdDirectoryService.findDirectoryById()
  • Directory.getType()

to get an enum DirectoryType for a user. I don't know if this is enough to distinguish the directories. Maybe even the directory id is enough if it's a local script.

Thanks Henning -- I'll look into those.

I do know that

  • User.getDirectoryId() will only give the directory id of the crowd connection in Jira. For example, I get a directory id of '2' -- which corresponds to crowd. But if I look at crowd, I see several ids for the individual directories.
Henning Tietgens Community Champion Feb 11, 2014

Ah... multiple directories in Crowd. Ok. I can't say anything for this situation, I think the data is only for the JIRA directories. Next time I try to read with more attention. Sorry.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published yesterday in Jira Software

How large do you think Jira Software can grow?

Hi Atlassian Community! My name is Shana, and I’m on the Jira Software team. One of the many reasons this Community exists is to connect you to others on similar product journeys or with comparabl...

309 views 4 9
Read article

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