RITM should get close once all catalog tasks are closed

tulasi8
Tera Contributor

Hi Community,

 

I want the RITM should get close only once all the catalog tasks are closed. I have written the business rule for this after update with the condition as state is closed complete.  But it's not working as per requirement. Can anyone please help on this. 

 

    var gr = new GlideRecord("sc_task");
    gr.addActiveQuery();
    gr.addQuery("request_item", current.request_item);
    gr.setLimit(1);
    gr.query();
    if (!gr.hasNext()) {
        var ritm = current.request_item.getRefRecord();
        ritm.state = current.state;
        ritm.update();
    }
 
Thanks,
Tulasi.
15 REPLIES 15

@tulasi8 

what debugging did you do? share the logs you added

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader