Workflow stuck - Catalog task completed however RITM is still in Fulfillment stage

Raghesh
Giga Expert

Hi,

We have one RITM in Fulfillment stage however the corresponding Catalog task is Closed and Completed. As per the workflow it should automatically close the RITM and REQ once the Catalog task is closed.

This happened to one old request and for the current requests it is working fine.

 

Is there any way we can restart or refresh the workflow to get this RITM closed.

 

I tried the Nudge option in Workflow Context but no luck.

 

 

regards,

Raghesh

 

 

1 ACCEPTED SOLUTION

Hi @Raghesh 

My Mistake.

 

Please put Request Numbers on 2nd line instead of RITM numbers.

 

Or just use number instead of request.number.

 

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023

View solution in original post

14 REPLIES 14

Hi @AnubhavRitolia 

Thank you for the script, I tried in my dev instance to close two RITMs but it is not working.

 

I just modified the stage as below.

-----------------------------------------------------

var ritm = new GlideRecord('sc_req_item');
ritm.addEncodedQuery("request.numberINRITM0010820,RITM0010815^active=true^stateNOT IN3,4,7");
ritm.query();

while(ritm.next())
{
ritm.state = 3;
ritm.stage = 'complete'; // Here 'delivery' is a choice. You can put your choice value which you want to update.
ritm.setWorkflow(false);
ritm.update();

var req = new GlideRecord('sc_request');
req.addQuery('sys_id',ritm.request.sys_id);
req.query();

if(req.next()) {
req.request_state = 'closed_complete';
req.setWorkflow(false);
req.update();
}
}

 

 

regards,

Raghesh

Hi @Raghesh 

 

I tried same code on my PDI and it works for me.

 

Can you show the REQ and RITM which you used in this example.

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023

Hi @AnubhavRitolia 

Please find the RITM screenshots below.

 

Raghesh_0-1667832456140.png

 

Raghesh_1-1667832482256.png

 

regards,

Raghesh

Hi @Raghesh 

My Mistake.

 

Please put Request Numbers on 2nd line instead of RITM numbers.

 

Or just use number instead of request.number.

 

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023

Hi @AnubhavRitolia 

Yes I changed to REQ number and it worked !!

Great! Thank you for your support!!

 

regards,

Raghesh