add user to watchlist with business rule

sola27
Tera Contributor

Hello everyone,

 

Does anyone know how can I archive this: When the caller id changes, change the watch list to the caller manager?

 I was trying with this code: 

(function executeRule(current, previous /*null when async*/) {
var calleruser = current.caller_id;
var newmanager = calleruser.manager;

if(current.caller_id !== ''){
    current.watch_list = newmanager;
    current.update();
}

})(current, previous);
0 REPLIES 0