Auto closure: Mark RITM Closed Complete if final active SCTask is marked with any completion status

VishalSawant
Kilo Contributor

Given all User catalog and Security catalog request SCTasks are created and worked

When the final active SCTask is marked with any completion status 

 

Then the User catalog and Security RITM information is automatically marked closed complete

1 REPLY 1

SumanthDosapati
Mega Sage

@VishalSawant 

If you want it for specific catalog item, then you can set the state in your Flow linked to Catalog item.

If you want it for all catalog items then you can create an after business rule on sc_task table with condition as state changes to closed complete

script as below

var sctask = new GlideRecord("sc_task");

sctask.addActiveQuery();

sctask.addQuery("request_item", current.request_item);

 
sctask.query();

if (!sctask.hasNext()){

 
var req = new GlideRecord("sc_req_item");

req.get(current.request_item);

req.setValue("state", <value_of_closed_complete>);

req.update();

}

 

Accept the solution and mark as helpful if it does, to benefit future readers.
Regards,
Sumanth