Request itself is closed but the RITM is still open
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2022 06:35 AM
when the Request itself is closed the RITM is still open and the only way to close it, is by deleting the RITM. Shouldn't the RITM's also close or change state from Open? It is confusing if you want to report on RITMs
- Labels:
-
Release Management
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2022 06:48 AM
Why deleting the RITM is the only way here?
Did you directly close the request?
There is no OOB logic that will close the RITM if you manually close the request
Aman Kumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2022 06:49 AM
Hello,
All catalog tasks would be closed first, then request items, then that closes the request.
The request shouldn't be closing before everything else.
Please correctly workflow/flow for this behavior.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2022 07:55 AM
Hello Akhila,
You can achieve this using before update business rule on "sc_request" table and in that business rule select the condition as "state changes to closed complete" and add the below code.
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var sysid=current.sys_id;
var gritem=new GlideRecord('sc_req_item');
gritem.addQuery('request',sysid);
gritem.query();
if(gritem.next())
{
gritem.state=3;
gritem.update();
}
})(current, previous);
Please mark my answer as helpful/correct if it helps you.
Thanks and Regards,
Namrata