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?
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}}
If this is not the requirement, please clarify..
of course you will add another if condition for when size equals 2..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.