The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Trying to split summary into First, Middle, Last

Akram Rajwani
March 14, 2024

Hi - We have a project where the issue summary field can be in the format of FirstName Lastname or FirstName MiddleName LastName. We'd like to split this and have them be automatically filled in 3 separate fields for First, Middle, and Last.

We have been able to get as far as using the split function to break the issue summary up and set the fields in the automation rule like such:

FirstName: {{issue.summary.split("_").get(0)}}

Middle Name: {{issue.summary.split("_").get(1)}}

Last Name: {{issue.summary.split("_").get(2)}}

This works great when the summary field has all first, middle, last - however when there is only first and last, the middle name takes on the value for the last (makes sense given that the .get(1) is now the last name)

How can I get this to work properly for the scenario where the summary field contains only first and last?

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
Kalyan Sattaluri
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 Champions.
March 14, 2024

Hello @Akram Rajwani 

Your summary will either have Fname_LName OR Fname_MName_LName only and never anything else or other formats?

You can do an if condition -> advanced compare, to check the size after your split and based on the count you can do updates accordingly. see below..

{{issue.summary.split("_").size}}

 

image.png

 

If this is not the requirement, please clarify..

Kalyan Sattaluri
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 Champions.
March 14, 2024

of course you will add another if condition for when size equals 2..

Akram Rajwani
March 21, 2024

This works great. Thank you!

Like • Kalyan Sattaluri likes this
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events