Hi eveybody,
we want to migrate a project, but there are invalid users: The have no mail address. The users are managed external from LDAP.
Now we have added Mailaddresses in LDAP and even ensured the database is clean. What we can see is: After some time (within an hour) in Jira itself the Mailaddresses disappear, also in the DB. We have no idea what's going on there.
Is it possible to enter an mail address directly into Jira even when it's managed external? Maybe with an property or similiar?
Thanks really a lot :)
In terms of migrations, the entities.xml file contains '<ApplicationUser ...' xhtml entries, containing the mail address. If it's there Jira will import it as is. There is no ldap sync during import.
You can do anything with the user details, they just simply get stored in cwd_user and Jira uses that table's data (from cache, mind you).
When an update is needed, depending on your environment, then Jira will update the table. Either you are updating the users on log-in -- and there this depends on your LDAP directory configuration, whether you are correctly configuring 'User Email Attribute' in User Schema Settings -- and this applies when you are updating user details on log-in, i.e. "Update User attributes on Login". If so, then this will simply "brute-force" overwrite the user's email. If it's null, then jira will save null, if it finds value, it saves that value. So if you are using this option, even if you set any mail for the user, if they log in, then Jira will update it to null again, if you don't have the mail attribute configured (or maybe it's wrong attribute name or something).
The other option is you're syncing users from LDAP periodically. If you're doing this out of box then above configuration should apply to that as well (looking here https://confluence.atlassian.com/adminjiraserver/synchronizing-data-from-external-directories-938847064.html). If you're using any add-ons for user sync (or log-in for that matter), then this could differ, but in the end it's probably the same problem with the user mail attribute.
It's a bit of a guess where exactly to look without being able to look around your instance but it's most probably going to be the attribute missing/misconfigured somewhere, would be my guess.
Hey @Radek Dostál thanks for your advice!
Ok, so what I see for an affected user:
- In Jira there's no mail address
- In the DB it is
- In the AD it is.
So with your hint I'd have a look for entities.xml. Where can I find this xml to verify it? I didn't find it at the moment.
Thanks a lot!
Hannes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
But how do you mean "in Jira there's no email" and "in DB it is" - if the DB has email then Jira should show you that email, unless you have corrupted caches, such as manually updating the table?
Are you sure that you are looking at the right user? You should have at minimum 2 directories in Jira, presumably, one for Internal User Directory (id:1) and another for LDAP (some higher id, probably 10001 or something).
I did not understand your question as it being a problem with import - rather a problem with user sync or on-login update. Strictly speaking the import behaviour differs between out of box native import (where you have a single huge .zip and select the project to import from that zip), to that of other plugins. I'm not sure if the native import overwrites the user's email if that user already exists. I know it will create it if the user is missing (along with the email), but not sure if it does updates to them, I think it doesn't actually, so long as it finds the right username, in whatever user directory. Then again it's been a while so not a 100% on that.
I'm a bit confused now, but if you see the email in the database, for the right user in the right directory id, then that sounds like corrupted caches and a restart should fix that, but I don't know how you've got to corrupt them unless you started manually updating the table.
The user can exist in multiple user directories, i.e. you can have the same username in both internal directory and external one. That way, you have 2 usernames in cwd_user, one row for internal, another for external. In this case Jira uses the one depending which user directory is first in order. If they have just a single row then Jira will only use that, regardless of directory order (imagine it just going top to bottom until it finds the username in that directory id).
When the user is logging in, then depending on your user directory order in Jira it will use the first one they have the username in to authenticate them. It will use the first one in order to create the user in if the user does not exist. So, if Internal directory is first, the import will create the user there, if you have LDAP first, then they get created with that directory id in the database.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
see my screenshot here - this is the same user. It does not make sense to me, but in the DB the mail is available and 'in Jira' it isn't.
A restart didn't solve that and in the LDAP the user's mail address is even there. Also the user does only exist in the LDAP.
When I try to run the Cloud Migration Assistant this user leads to an error and we have no idea why... Is it more clear now? Before I saw that I even thought this is not possible - but it is.
Best,
Hannes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.