Modify a scheduled script to send only if the knowledge base sys id is matched

misolarz
Tera Expert

How can I modify the scheduled script to send the notification - KM: Article Expiry Warning only if the sys id is matched, I am new to coding and unsure if what I have is correct. Any pointers and tips would be appreciated.

1 REPLY 1

Sandeep Rajput
Tera Patron
Tera Patron

@misolarz Replace the script in your condition field on the scheduled script as follows.

 

answer=false;
var kbKnowledge = new KBKnowledge();
var expectedSysID= '79783aa81b1b8110244e7558dc4bcbfa';
if(kbKnowledge.ys_id==expectedSysId){
answer=true;
}

This will make the schedule job only run when the sys_id of the KB article and expected sys_id matches.

 

Hope this helps.