Close the RITM after all the catalog tasks are closed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
I have a requirement in which I need to generate 6 tasks in parallel.
Since I am using flow designer, I have checked the wait checkbox under each catalog task action. At the same time, RITM should get closed complete after all the tasks are complete.
Since I have checked the wait checkbox, it's not waiting and executing the if condition in 12th line number and returning false.
Actually, it needs to wait till all the tasks completion. How can I close the RITM only after all the tasks are complete.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Hi @divyadhanda
same solution.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
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/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
since the catalog tasks are in Parallel, you can use after update BR on sc_task
BR: After Update on sc_task
Condition: State [IS ONE OF] Closed Complete/Closed Incomplete/Close Skipped AND Request Item.Item == Your Catalog Item
Script:
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var taskRec = new GlideRecord("sc_task");
taskRec.addEncodedQuery("request_item=" + current.request_item + "^active=true"); // if no active tasks for this RITM exists
if (!taskRec.hasNext()) {
var ritm = new GlideRecord("sc_req_item");
if (ritm.get(current.request_item)) {
ritm.state = 3;
ritm.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 || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
if you want to stick to flow designer then at Step 12 add the logic shared in below link
Flow Designer: Wait with RITM closure until all tasks are closed
sharing the same here
- Use "Look up Records" action for sc_task table to find all records that matches the request_item.
- Use action "For Each" on above results
- Use action "Wait for condition" where Active is false.
💡 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 || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Can i get the exact condition mentioned in step 29,30,31?
