I have successfully used the following script to add multiple users as watchers to a task as a post function of a transition:
function SetWatchers() {
if(field1 == "ABC")
watchers = addElement(watchers, "xyz1");
}
When I tried to add different options as below, I recieive an error which says "Encountered else in line xxx. Was expecting <EOF> :
else {
if(field1 == "DEF")
watchers = addElement(watchers, "xyz2");
} else {
if(field1 == "GHI")
watchers = addElement(watchers, "xyz3");
}
What am I missing?