- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-22-2024 03:06 AM - edited ‎10-22-2024 03:07 AM
Hi Community,
I've recently found that we have 289 requests in our instance with no RITMS attached (not sure how this happened) and am trying to bulk close these as there's no use for them.
When looking at the request table I cannot find anything on the filter relating to related lists (screenshot below) to show REQ's with no RITM so am wondering on how best to get these closed off.
Many thanks,
Alex
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-22-2024 03:38 AM
Hi Alex,
Check this. Similar Question is answered there.
Solved: Re: How do I filter on REQs to show REQs with no r... - Page 4 - ServiceNow Community
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-22-2024 03:38 AM
Hi Alex,
Check this. Similar Question is answered there.
Solved: Re: How do I filter on REQs to show REQs with no r... - Page 4 - ServiceNow Community
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-22-2024 03:54 AM
You can create a report on REQ Table and add Related List Filter to get all the Requests with no ritm's attached list.
Write a fix script to close the Requests with NO RITM's.
var grScRequest = new GlideRecord('sc_request');
grScRequest.query();
while (grScRequest.next()) {
var grScReqItem = new GlideRecord('sc_req_item');
grScReqItem.addEncodedQuery("request=" + grScRequest.sys_id);
grScReqItem.query();
if (!grScReqItem.hasNext()) {
//update req state here.
grScRequest.request_state = 'closed_skipped'; //change state value
grScRequest.update();
}
}
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP