Auto Closure of REQ and RITM when all the associated tasks are closed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
I have a requirement to close the parent REQ and RITM when all the associated child tasks are Closed.
It looks like OOTB functionality as I verified in PDI as well but I am facing an issue that when the RITM has multiple tasks and when the last task to be closed is manually created then the parent REQ and RITM does not get closed.
Can anyone suggest me the approach to resolve this as I am not able to find the appropriate script or flow that runs commonly for all tasks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Please check is the stages has been set properly in flow?
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
you can use business rule or flow designer for this
BR approach: I shared the script few years ago; check this
How can we close RITM when all the catalog task is closed for that item?
you can use after update BR on sc_task
Condition: State [IS ONE OF] Closed Complete/Closed Incomplete AND Request Item.Item == Your Catalog Item
Script:
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var gr = new GlideRecord('sc_task');
gr.addQuery('request_item', current.request_item);
gr.addActiveQuery();
gr.query();
if (!gr.hasNext()) {
// close RITM
var ritm = current.request_item.getRefRecord();
ritm.state = 3;
ritm.update();
// close REQ
var req = current.request.getRefRecord();
req.state = 3;
req.update();
}
})(current, previous);
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Flow Designer approach: I shared solution few years ago
I have shared solution below using flow designer to close parent INC when all child INCs are closed.
Enhance it for sc_req_item and sc_task table and to close REQ
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader

