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?