I've been trying to tailor a SIL script to first check if one or more components exist in a ticket, if TRUE, assign to an agent and also add another agent as an Additional Assignee. My listener is set to listen to Issue Created, Issue Moved, and Issue Updated.
All Salesforce component leads are set to User1.
I have written it so if there is no assignee, then it should assign to User1 and add User2 as Additional but I have seen tickets where it is already assigned to User1 but User2 was not added as an Additional Assignee.
My current script looks like this:
//customfield_10090 is custom field Additional Assignees
if(project != "PrjctKey") {return;}
if(elementExists(components,"SALESFORCE | GENERAL")
or elementExists(components,"SALESFORCE | PROFESSIONALSERVICES")
or elementExists(components,"SALESFORCE | SECURITY")
or elementExists(components,"SALESFORCE | SERVICE"))
{
if(assignee=="")
{
assignee = "User1";
customfield_10090 += "User2"; // += add to existing,= rewrite
}
}
Is this the best way to approach my objective?