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,
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?
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!
Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...
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!
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