When any one task is getting cancelled need to cancel rest all task and need to cancel the ritm
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2022 04:51 AM
Can anyone please help me how to achieve this.
I am creating 4tasks at a time when the request is getting submitted. Tasks are getting created from flow designer. If any one of the task is getting closed complete or closed skipped rest all task need to set as closed skipped or closed incomplete and ritm should get update as closed incomplete. Not able to do in flow designer.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2022 06:38 AM
Hello
You can do it by using a simple business rule, triggered when catalog task state is set to "closed Complete", to run the following code:
closeRelatedTasks();
function closeRelatedTasks(){
var gr = new GlideRecord("sc_task");
gr.addQuery("requested_item", current.requested_item);
gr.addQuery("sys_id", "!=", current.sys_id); //exclude current task
gr.query();
while(gr.next()){
gr.state = 7; //Closed Skipped
gr.update();
}
var ritm = new GlideRecord("sc_req_item");
ritm.get(current.requested_item);
if(ritm){
ritm.state = 7; //Closed skipped
ritm.update();
}
}
Maybe you need to change the state codes I inserted there.
In order for you to do it in flow designer, you need to create a new Flow with a trigger on top of the sc_task table when the state changes to "Closed Complete" or "Closed Skipped".
The action should contain the code I mentioned before.
If you consider this answer is helping you, please mark it as "Helpful".
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2022 08:21 AM
Hi Filipe,
thank you for reply. I need to make all task state to closed skipped when any of the task is getting closed skipped or closed incomplete.
Suppose task1,task2,task3 and task 4 are generating at a time if suppose task 2 is getting closed skipped or closed incomplete then task 3 and task4 also will get automatically closed skipped.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2022 09:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2022 09:57 AM
Hi pritimayee,
This can be archived with the simple flow using flow designer.
Trigger conditions:
Action: Select Update multiple records action and right side data section drag and drop the catalog task table.
On conditions
1. select the Request item field on catalog task table(sc_task)
2. state is not closed complete // if tasks are closed complete ignore or add required conditions
Fields section: update the state as closed Incomplete.
Hope it helps!!
Please Mark ✅ Correct/helpful, if applicable, Thanks!!
Regards
Pavankumar
ServiceNow Community MVP 2024.
Thanks,
Pavankumar