Importing LDAP users into custom field

SylviaL August 23, 2011

My question is on LDAP user import. We have configured Jira with our internal LDAP user directory. We have a custom field named "verifier" of type User Picker. When I import user names (in First Last name format) from a CSV, names are not mapped to the corresponding LDAP user but new Jira users are created instead (I selected the "create new users" option in the import wizard). Names for the built-in fields such as assignee and reporter on the same import are mapped to the correct LDAP users. Can someone please guide me in how I can import LDAP users into the custom field?

Thanks in advance!

1 answer

0 votes
Jeremy Largman
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 23, 2011

Hi Sylvia,

So, a couple notes first. When you import users from a CSV file, they go into JIRA's internal user directory. Your LDAP users are in the LDAP user directory. You'll choose which directory gets preference in your LDAP configuration (See 'Managing Multiple Directories'). In your case, you'll (I think) want the LDAP directory on top, so it's preferred.

I think the crux of the problem is that you cannot mix and match across directories. From that doc I linked above:

Duplicate usernames across directories are not supported. If you are connecting to more than one user directory, please ensure that the usernames are unique to one directory. For example, if you have a user <tt>jsmith</tt> in both 'Directory1' and 'Directory2', that is an unsupported configuration.

I'd suggest focusing on the usernames in your LDAP connection configuration. When you connect to your internal LDAP repository, you can choose the username attribute (Check 'User Name attribute' from Connecting to an LDAP directory).

One last note about all this - the reason I'm focusing on your user management and directories is that the user picker custom field is just pulling from that. It's going to display the user names of whoever's in your user repository. So too when specifying an assignee or reporter when searching for an issue, or anywhere that users' names are exposed (or at least it's supposed to work like that).

I hope I'm understanding your question right? Post a comment back if I've misunderstood. Also, post what's the order of your repositories - maybe that has to do with the discrepancy you're seeing?

SylviaL August 24, 2011

Hi Jeremy,

Thanks for your reply. I have our internal LDAP set to top preference in the configuration. I’m using sAMAccountName as the User Name Attribute in the LDAP Schema setting.

I'm still unsure of the name format. I tested out two import scenarios:

1. When a user logs on with their LDAP credential for the first time, a user profile is created in Jira with <Last, First> as the full name, the correct LDAP email and LDAP username. If the name field of a bug to be imported has the LDAP username value, the field will be mapped to this LDAP user correctly. For this case, the bug imported will show Last, First name format in the bug details. If the import data csv name field is in <First Last> or <Last, First> format, it doesn't map to the LDAP user but new profiles are created.

2. When I tried importing with 3 different formats (<First Last>, <Last, First>, <LDAP username>) without first creating any user in the system, 3 different users will be added. User name, full name of the new accounts are the name value from the csv field and no LDAP email is added. After that, if the user signs in for the first time with their LDAP credential, the LDAP username profile is recordedfor login count. If I use LDAP username for import, the bug imported will show the LDAP username in the bug details.

This is an issue if I have a subset of accounts created through auto-registration and others created through the data import wizard. The names in the bug details will become inconsistent (some will be <Last, First> while others show LDAP user name). And in case 2, the email value is not populated correctly. Is there configuration I can do for it to accept multiple user name format?

Thank you,

Sylvia

Jeremy Largman
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 24, 2011

Thanks for the specific description. It sounds like you've hit a known limitation. It sounds like you have two separate problems:

  1. The importer isn't smart about associating usernames.
  2. You'll need to have a user log in before a csv imported bug can be associated with them.

This sounds to me like a feature request/improvement to the csv importer. Scenario 2 ought to work like Scenario 1. That is, regardless of whether a user has logged in, the CSV user creation ought to do an LDAP lookup to see if the user exists in LDAP and associate the newly created bug with that user, despite whether they've logged in or not.

It looks like a different user already came across this. Here's the report:

https://studio.atlassian.com/browse/JIM-595

You can weigh in on that request (perhaps link to this discussion). I think actually there's a second bug report to create, which is about a different behavior for users who haven't logged in yet. You can raise an improvement/feature request yourself (you'll be subscribed to it, and you can put it in your own words what you want).

As for a workaround, nothing great is coming to mind. How many issues/users are we talking about? If it's a manageable number, you can edit the reporter later and delete the duplicate user.

Also I tagged this as 'csv' and 'import'.

SylviaL August 24, 2011

We are about to rollout a pilot for several teams totally around 100 users. If the pilot is successful and this gets adopted corporate-wide, we are looking at hundreds+ of users and manual editing won't be feasible at that scale.

Jeremy Largman
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 24, 2011

To boil it down - would your problem be solved if the bug to be imported from CSV were associated to the correct username, despite that user not yet logging in? Or do you also need better username mapping?

Maybe there's a better workaround for this. Is there another option besides CSV? Where are you getting this CSV file from?

SylviaL August 24, 2011

I'm testing with a CSV exported from another Jira instance but we have plans to also import 1000+ bugs from QuickBase. I'll be needing better LDAP lookup as user names would not be available in the QuickBase (only first/last names). Can you think of any other way I can import names successfully?

Jeremy Largman
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 25, 2011

You can use the JIRA Command Line Interface, and maybe have better luck. Here's all the documentation on it. This one, in particular:

jira --action createIssue --project "zjiracli" --file "src/itest/resources/data.txt" --type "1" --summary "This is content." --assignee "automation" --date ""

If you search createIssue on that page, you might find some tips. There's a lot of flexibility with the remote API, and Bob's client does a good job of making it pretty accessible. Maybe you can somehow programatically convert your usernames by a script, then use the CLI from there?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events