How to add CC in the notification activity of workflow in ServiceNow

Arun91
Tera Contributor

Hi Team,

I have a requirement to add cc in the notification activity of workflow in ServiceNow. Could some one please help me on that.

 

Thanks in Advance

19 REPLIES 19

Arun91
Tera Contributor

It is working . I need to send an email to the last updated by who updates the asset in servicenow.

@Arun91 
You can use the same syntax by doing small modification

Instead of current you can use the glide object, rest will be same

Arun91
Tera Contributor

This is the code i have used it

var abc = new GlideRecord("cmdb_ci_computer");
    abc.addQuery('sys_id',current.sys_id);
    abc.query();
    while(abc.next()) {
    var def = abc.getValue(sys_updated_by);
    var u = abc.sys_updated_by.toString();
    var xyz = new GlideRecord("sys_user");
    xyz.addQuery('sys_id',u);
    xyz.query();
    while(xyz.next()){
    email.addAddress('cc', xyz.getValue('email'),xyz.getValue('first_name'));
    }
    }

Arun91
Tera Contributor

The above mentioned code is not working could you please guide me

@Arun91 

 

Try to use the below code, I hope this should work

var abc = new GlideRecord("cmdb_ci_computer");
    abc.addQuery('sys_id',current.sys_id);
    abc.query();
    while(abc.next()) {
    var u = abc.sys_updated_by.toString();
    var xyz = new GlideRecord("sys_user");
    xyz.addQuery('user_name',u);
    xyz.query();
    while(xyz.next()){
    email.addAddress('cc', xyz.getValue('email'),xyz.getValue('first_name'));
    }
    }