- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2022 01:45 AM
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
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2022 06:53 AM
Hi @Raghesh
My Mistake.
Please put Request Numbers on 2nd line instead of RITM numbers.
Or just use number instead of request.number.
Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2022 06:27 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2022 06:35 AM
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.
Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2022 06:48 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2022 06:53 AM
Hi @Raghesh
My Mistake.
Please put Request Numbers on 2nd line instead of RITM numbers.
Or just use number instead of request.number.
Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2022 05:20 AM
Yes I changed to REQ number and it worked !!
Great! Thank you for your support!!
regards,
Raghesh