RITM should get close once all catalog tasks are closed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2025 06:14 AM
Hi Community,
I want the RITM should get close only once all the catalog tasks are closed. I have written the business rule for this after update with the condition as state is closed complete. But it's not working as per requirement. Can anyone please help on this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2025 09:40 PM
Hello @tulasi8
At action number 61, if you're setting the RITM state as "closed complete" and then ending the flow, remove actions 60 and 61. Instead, outside of the "If" block (action number 54), use the "Look up records" action as per my reply.
Please mark this response as Correct and Helpful if it assists you.
Thanks,
Ashish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2025 05:05 AM
Hey @tulasi8, hope you are doing well.
Have you tried my solution? Let me know if it doesn't work. If it does, please mark it as 'Helpful' and 'Accept' it as a solution, then close the thread so that future community readers can use it.
Thanks,
Ashish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2025 11:55 PM
Hi @tulasi8,
Please use the flow designer logic exactly as shown below. In your current flow, you are checking if the state is Closed Complete, but instead, your flow should wait until the state of all SCTasks is either Closed Complete or Closed Incomplete before proceeding.
Let me know if you need any help implementing this.
In Wait for condition , dont check enable timeout check box and also dont specify any time limit , so that it will wait till the state of sctasks are closed or not
Thanks regards
Badrinarayan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2025 06:57 AM
you should have after update business rule on sc_task
Condition: Active [Changes to] False AND current.request_item.cat_item.name == 'Your Item'
Script:
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var taskRec = new GlideRecord('sc_task');
taskRec.addActiveQuery();
taskRec.addQuery('request_item', current.request_item);
taskRec.setLimit(1);
taskRec.query();
if (!taskRec.hasNext()) {
var ritm = current.request_item.getRefRecord();
ritm.state = 3;
ritm.update();
}
})(current, previous);
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
07-10-2025 08:36 PM