Skip to main content

I'm trying to create a workflow to reset a Microsoft Active Directory (AD) user password.

To do this, I need to generate the username in the format JDoe for a user named John Doe.

 

Input:

I want to use the Requester Name field from the Service Item, which contains the full name of the user (e.g., John Doe).

 

Problem:

I’ve tried using the following expression, but no matter what I do, it doesn’t work.
Instead of getting JDoe, I get JJohn Doe.

 

 

concat( toUpperCase(substring(trim('{{ticket.actual_requester.name}}'), 0, 1)), regexReplace(trim('{{ticket.actual_requester.name}}'), '^\\S+\\s*', '') )

 

i tried different Variation, also the eMail-Adress field, Nothing is working

@paddyb79 the below should work under the scenario you presented eJohn Doe], I’ve also wrote it to include being able to handle a three name option pJohn Alex Doe].  Both will present JDoe as the end result.

concat( toUpperCase(substring('{{ticket.actual_requester.name}}', 0, 1)), regexReplace('{{ticket.actual_requester.name}}', '^.* ', ''))


you made my Day ITMike - thanks