after all iterations, needs to update RITM closed complete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2025 09:21 AM
There are 1 to 15 iteration/subflow calling, after this subflow calling want to update RITM close complete, as per present set up its updating prematurely, that means without completing all iterations its updating closed complete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2025 09:56 AM
Hi @venkata2023
May you consider create a Business rule after > updated in your sc_task table, advance = true
Code:
if (current.state != '3') // 3 = Closed Complete (adjust if different)
return;
var taskGR = new GlideRecord('sc_task');
taskGR.addQuery('request_item', ritm);
taskGR.addQuery('state', '!=', '3'); // still open tasks
taskGR.query();
if (!taskGR.hasNext()) {
// All tasks are closed → close the RITM
var ritmGR = new GlideRecord('sc_req_item');
if (ritmGR.get(ritm)) {
ritmGR.state = '3'; // Closed Complete
ritmGR.update();
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2025 10:10 AM
There are no tasks on the flow, its adding user to the groups
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2025 10:23 AM
please move the logic of closing RITM in your main flow or using after update business rule on 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
‎08-25-2025 02:22 PM
Hi ankur, thank you for your reply, there are no tasks in this flow, i am calling subflow for each list collector value, after completing for each loop, i want to update RITM close complete