I am using JJUPIN to pull in a user property that has been pulled from LDAP.
The field is comes in like this -
CN=FirstName LastName, random stuff I don;t need, more stuuf...
Is there a way to only bring in the first name and last name?
This is the code I am using
customfield_10100 = getUserProperty(reporter,
"manager"
);
Hi Jenifer,
Well, depends on what information was actually pulled from LDAP to the user properties. If there's a property that only has the manager's first and last name, then you can just use that property (maybe check with your admins if they can add one such property). Otherwise you'll just have to chop around that string to only leave the first and last name (drop first 3 chars and everything after the first comma, assuming the rule is the same for all users).
Another option would be to use the http://confluence.kepler-rominfo.com/display/SIL30/ldapUserStruct routine and query the LDAP directly.
Hope this helps!
This - Otherwise you'll just have to chop around that string to only leave the first and last name (drop first 3 chars and everything after the first comma, assuming the rule is the same for all users). Is what I think I need to do, can you give me a starting point on how I can code that?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Once you have the full proprty value returned by getUserProperty, you can find the first index of a comma using http://confluence.kepler-rominfo.com/display/SIL30/indexOf and then http://confluence.kepler-rominfo.com/display/SIL30/substring starting at index 3 and ending at the index returned by indexOf. Note that indexOf returns -1 if comma is not found. More string manipulation routines here: http://confluence.kepler-rominfo.com/display/SIL30/String+Routines Hope this helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.