- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2024 10:53 AM
Hi all,
How to Cancel all SC Tasks in RITM when RITM state changes to Close Incomplete using Business Rule.
The requirement is to close all SC Task under Closed Incomplete RITM's.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2024 06:10 AM
That is the OOB behaviour, to avoid this you can simply take one group's sys_id of servicedesk or some generic group and write "tasks.assignment_group = <sys_id of assignment group>;
Please mark helpful/correct if my response helped you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2024 11:01 AM
Hi @dhanashree2011 ,
You can write a BR on sc_req_item table with the filter when state changes to closed incomplete.
Under script you can query the sc_task table using the RITM number on "request_item" column on sc_task table and then you will get all the associated sc tasks with the RITM and then you can update all related sc tasks.
Please mark helpful/correct if my response helped you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2024 11:06 AM
Thanks Anubhav.
I tried this as below but seem it is not working
var tasks = new GlideRecord('sc_task');
tasks.addQuery('requested_item', current.sys_id);
//tasks.orderBy('order');
tasks.query();
while (tasks.next()) {
tasks.state = 4;
tasks.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2024 11:08 AM
I tried below
var tasks = new GlideRecord('sc_task');
tasks.addQuery('sys_id', current.sys_id);
//tasks.orderBy('order');
tasks.query();
while (tasks.next()) {
tasks.state = 4;
tasks.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2024 11:11 AM
Please post screenshot of your BR @dhanashree2011