I am trying to execute a script on a template in the 'Field and Form' rules to get a variable and append it to the subject line.
I have an onboarding form/template where the HR team will input the username in the form. I am trying to get that name and append it to the
Current Subject line is 'New Hire Notification'
The two fields in the form that HR will enter are:
'New Employee First Name' Joe
'New Employee Last Name' Smith
I would like the end result to be '#12345 New Hire Notification Joe Lewis Unclaimed Funds Auditor 4'
The script I have comes close:
This script produces this: '#12345 Joe LewisUnclaimed Funds Auditor 4'...It just needs a space after the name.
var x=$CS.getValue("ServiceReq_User_UDF_CHAR27"); First Name
var z=$CS.getValue("ServiceReq_User_UDF_CHAR1"); Last Name
var u=$CS.getValue("SUBJECT"); Subject from the ticket 'New Hire Notification', not populating
var v=$CS.getText("GUDF_CHAR27"); Job Title
var y=x + " " + z + v;
$CS.setValue("SUBJECT",y);
I just want to remove the space: '#12345 Joe Lewis Unclaimed Funds Auditor 4', this would be acceptable. Better would have the existing Subject line included '#12345 New Hire Notification: Joe Lewis Unclaimed Funds Auditor 4'
I have tried editing the script but nothing works. This seems like it should be simple but I don't know javascript.