Close the Requested Item record when all the associated Catalog Tasks are closed- Used For eachitem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2025 06:59 AM
Multiple catalog tasks should be created so I used the below flow steps , everything is working fine except when I am closing all the catalog tasks then Request item record and request record are not closing but this should be closed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2025 07:05 AM
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.addQuery('active', true);
gr.query();
if(!gr.next()){
var ritm = current.request_item.getRefRecord();
ritm.state = 3;
ritm.update();
}
})(current, previous);
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
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2025 12:32 AM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader