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


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

0 votes
Accepted answer

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!

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.

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
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,041 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