Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

CC related list fields

Poorva Bhawsar
Mega Sage

Hi Community,

 

When a knowledge article is created and before publishing it, users adds affected cis under related list post publishing it, it will trigger an email for ka is published. I want to CC affected cis records managed by and portfolio group users in that email.

 

Here is my email script:

 

var group = current.u_portfolio_group.split(",");
    var managed = current.managed_by;
    var gr1 = new GlideRecord("m2m_kb_ci");
    gr1.addQuery("sys_id", group);
    gr1.addQuery("sys_id", managed);
    gr1.query();
    while (gr1.next()) {
        email.addAddress("cc", gr1.email, gr1.getDisplayValue());
        //email.addAddress("cc", gr1.managed.email, gr1.managed.name.getDisplayValue());
    }
 
But its not CCing those group members which portfolio group contains along with the managed by user.
0 REPLIES 0