Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

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 Leaders.
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 Leaders.
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

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events