ServiceNow workflow run script to check if all the catalog tasks are closed for the current RITM

var tsk = new GlideRecord(‘sc_task’);
tsk.addQuery(‘request_item’, current.sys_id);
tsk.addActiveQuery();
tsk.query();

if(tsk.next()){
answer = false;
}
else{
answer = true;
}