Hello,
I am looking for guidance in sending an email addressed to the reporter of an issue when a status changes. The interesting dilemma I am facing is that most display names are in the format Last Name, First Name and some individuals have, in brackets after their first name, their pronouns. For example - display name is Doe, Jane (She/Her/Hers).
In this example, I would like the email to read Dear Jane however cannot identify how to do so. I have tried {{issue.reporter.displayName.split(", ").last}} and it returns (She/Her/Hers) - Any ideas?
Hi @Jessica -- Welcome to the Atlassian Community!
Unless you know the exact and consistent layout of the display names for your users, this can be difficult to solve. There is only the "Full Name" (displayName) in the profile, with no separation of first, last, etc.
If you assume the layout you have shown, you could use the text function substringBefore() or substringBeforeLast() to remove the text:
{{issue.reporter.displayName.substringBefore("(").split(",").last.trim()}}
Kind regards,
Bill
Thank you so much Bill! That works like a charm :)
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.