Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

Some legacy project tasks are not closed even after 5 years

ServiceNow Use6
Tera Guru

Hi,

All catalogue and request items under closed legacy project task should be closed. Please investigate why some are still open. When I check the flow context, the condition should be Active is false, but the RITM are Active. So the RITM are waiting on the condition and never completing the flow.

RITM.png

 

sc_task.png

 

I wrote a Fix Script to make the RITM as false and close the RITM. Now I need to makes sure that the flows should be triggered so that they will complete the flow. I don't know how to see that the flows run automatically. There are 400 of them with the same condition.

 

fix.png

var gr = new GlideRecord('sc_req_item');
gr.addEncodedQuery('stateNOT IN3,4,7^sys_created_on<=javascript&colon;gs.beginningOfLast2Years()^active=true');
gr.query();
while(gr.next()){
	gr.active = false;
	gr.state = 3;
	gr.work_notes = 'making state as close complete and setting the active status to false so flows might start executing';
	gr.update();
}

 

 

Regards

Suman P.

0 REPLIES 0