Pause software task until the hardware task's RITM gets complete

Sounderrajan K
Tera Contributor

I have order guide which includes both hardware and software request item.I have requirement that need to hold the software request sctask generation until the hardware request item completes.I need to write a wait for condition in software request workflow and I need to check 5 hardware item and then check the hardware request item state is close if it is true then trigger software task.However the wait for condition is not re-evaluating.

 

Wait for condition script:

var hardwareItems = gs.getProperty('onboarding.og.hardware.catalogitems', '');//list of hardware item Sys ID used in Order Guide
var reqItem = new GlideRecord("sc_req_item");
reqItem.addQuery('request', current.request);
reqItem.addQuery('sys_id', '!=', current.sys_id);
reqItem.addQuery('cat_item.sys_id', 'IN', hardwareItems);
reqItem.query();
if (reqItem.next()) {
    if (reqItem.state == '3') {//hardware task RITM close complete
        answer = true;
    } else {
        answer = false;
    }
}
0 REPLIES 0