how to set inbound reply email CC users into watch-list

Sironi
Kilo Sage

Hi,

Some one help me , is my script line is correct or Not ?

when case created automatically sending one email to "Advin kumar "User,  when "Advin kumar" used to send reply back & added some users  in CC, BCC. 

now i want to take only CC users from reply mail and add into Watch-list

add CC users into Watch-list

script:     current.watch_list +=email.copied;

find_real_file.png

 

 

 

1 ACCEPTED SOLUTION

var arr = [];
var id = email.copied.split(',');

gs.log(' id is '+ id.length);

for(var i = 0 ; i < id.length ; i ++){

var gr = new GlideRecord('sys_user');

gr.addQuery('email','IN',id[i]);

gr.query();

while(gr.next()){

arr.push(gr.sys_id.toString());



}
}

current.watch_list = current.watch_list +','+arr.toString();

 

Working Code.

View solution in original post

18 REPLIES 18

sent

var arr = [];
var id = email.copied.split(',');

gs.log(' id is '+ id.length);

for(var i = 0 ; i < id.length ; i ++){

var gr = new GlideRecord('sys_user');

gr.addQuery('email','IN',id[i]);

gr.query();

while(gr.next()){

arr.push(gr.sys_id.toString());



}
}

current.watch_list = current.watch_list +','+arr.toString();

 

Working Code.

i used below script it is working fine in my PDI , but when i applied at client instance and tried to test it is showing user name undefined  in watch-list , user already existed in User table. but still it is showing like undefined .

Inbound action

var arr = [];
var id = email.copied.split(',');
gs.log(' id is ' + id.length);
for (var i = 0; i < id.length; i++) {
var gr = new GlideRecord('sys_user');
gr.addQuery('email', 'IN', id[i]);
gr.query();
while (gr.next()) {
arr.push(gr.sys_id.toString());
}
}
current.watch_list = current.watch_list + ',' + arr.toString();

 

 

Result :

Hi,

My Requirement is send all the emails through BCC field but not TO field except the emails starts with 'snow'. 

pls assist me in which table, do i need to write and how to do?