Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Send Email Referencing First Name When in Format Last Name, First Name (Pronouns)

Jessica
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 5, 2022

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? 

1 answer

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 6, 2022

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

Jessica
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 7, 2022

Thank you so much Bill! That works like a charm :) 

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events