- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2017 03:24 AM
Hi,
I am currently working on Request, RITM and Catalog Task.
I have got a requirement to close the parent RITM when all the child Catalog Tasks are complete and also need to close the parent Request record when all the child RITM's are complete.
Could someone please let me know what needs to be done here. I know I need to script a BR here but not sure what to put in there.
Thanks in advance.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2017 05:12 AM
Hi,
Try below code:
// If you have more than one RITM for REQ then Use this Code.
var getRITM = new GlideRecord('sc_req_item');
getRITM.addActiveQuery();
getRITM.addQuery('request',current.request);
getRITM.query();
if(getRITM.next())
{
//DO whatever you want to do here;
//Dont close REQ as One of the RITM Is open.
gs.addInfoMessage('REQ cant be closed because one of the RITM is Open');
}
else
{
var req = new GlideRecord('sc_request');
req.addQuery('sys_id',current.request);
req.query();
if(req.next())
{
req.req_state = 'closed_complete';
req.update();
}
}
Thank you,
Ashutosh Munot
Please Mark Correct, Helpful or Like.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2017 12:17 PM
It is on the RITM table. First Business Rule. Mailed you. Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2017 11:29 PM
Ashutosh, I forgot to tell you about the domain. I mailed you about the domain you have to move to. Please check. Thanks in advance.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2017 11:54 PM
Ohk

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-22-2017 02:48 AM
HI Prudhvi,
THis is done. Please check and let me know.
It will be good if you mark it correct.
Thank you,
Ashutosh Munot