request is still open even the SCTASK's and RITM's are closed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2022 12:04 AM
Hi All,
we have some bulk number of requests are still open even the RITM and SCTASK's are closed
RITM state and stage is closed
and workflow state is showing as finished
can any one let me know the root cause ??
Thank you,
Shabbir
- Labels:
-
Multiple Versions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2022 12:14 AM
Alternatively you can have this background script to close all existing requests where RITM are closed
var req = new GlideRecord('sc_request');
req.addActiveQuery();
req.query();
while(req.next()){
// check if there are any active requested items under it
var req_item = new GlideRecord('sc_req_item');
req_item.addQuery('request',req.sys_id);
req_item.addActiveQuery();
req_item.setLimit(1);
if(req_item.next()){
// do nothing
}
else{
req.state = '3';
req.active = false;
req.setWorkflow(false);
req.update();
}
}
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2022 09:30 AM
Where exactly would you put this script?