Notification

CE_
Tera Contributor



5 REPLIES 5

@CE_ , you can use the below script in the advanced condition of the notification and update the script according to your requirement like the 'tablename' query.

 

if (current.state == '1') {
    var gr1 = new GlideRecord("sys_audit");
    gr1.addQuery("tablename", "incident"); // change the table name
    gr1.addQuery("documentkey", current.sys_id);
    gr1.addQuery("fieldname", "state");
    gr1.addQuery("oldvalue", "2"); //check if the old value of record is in progess.
    gr1.query();
    if (gr1.next()) {
        answer = false;
    }
} else {
    answer = true;
}

 

 

Please Mark my answers Helpful & Accepted if I have answered your questions.

Thanks,

Alka