Hi all, we’re trying to write an identity attribute cloud rule that sets the uid for non-employee users (source type: Non-Employee). However, after the rule was deployed, we found out that it doesn’t find the account for the user or basically
returns null. idenityName variable above is an argument of the function that tries to generate a unique uid (and has the above code) and is called with identity.getName() passed in as the value of the argument.
NELM accounts are created through a form, and we already checked to see if the reason is that the account hasn’t been fully created yet but even when we use the rule on existing accounts, it returns null for the line above. Any thoughts?
Hi @ArefS ! Please note that Sailpoint discourages to generate unique attribute values like uid or email, but as in some cases are necessary, my experience with these rules is that when the identity is being created, most of it attributes are null (for example, if you call the getAttribute method).
Please check in Identity Profile, in the Preview screen, and enter some previously created identity. Can you see some value there?
Also take into consideration that every refresh of the Identity Profile will end in the rule revaluation, so if you check for existance and generate the value based on this, perhaps it will generate a new value in each refresh.
Hi @jsosa, the identities have the value (in this case uid and identificationNumber) there. To help us troubleshoot, I assigned some value to the variable I return at the end of the function to see where it gets stuck/does not work.
Through oldValue condition we check to see if the value is already assigned and we don’t recalculate it
This is the entire code. The value returned is ErrorCheckingAccount for new users’ uid. For existing users, I assigned this rule identificationNumber and I got ErrorCheckingAccount as well for them.
So, as you can not log in this rule, you can figure which line throwed exception. Other thing I do in this kind of rule, is insert a return line at very time I can. For example, in your code,
and so on. This will force the uid to have some value (at least, the Exception message, and even better, some text that perhaps canl show you at which line you are having error).
I ended up solving the issue. The problem was that the original name of the source was stuck somewhere and the rule couldn’t find the account associated with the identity. (Even though the name of the source showed as NELM when getting it through cc/api). We deleted the source and created a new one with the correct name and the rule worked.