close multiple catalog tasks when ritm is closed..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-18-2020 01:43 AM
HI,
I want to set state as closed complete for all catalog tasks when ritm state is closed complete..This is happens for only 1 catalog item only..
Here i wrote brule on requested item
after ,update
when to run:state changes to closed complete and Item is .....
var reqItem= new GlideRecord('sc_task');
reqItem.addQuery('request_item',current.sys_id);
reqItem.query();
while(reqItem.next()){
reqItem.setValue('state',3);
reqItem.update();
}
Here when i close ritm state only 1 catalog task is closed, after closing 1st task 2nd is opened but not closed it is in open state....how to achieve?
Thanks in advance...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2022 06:00 AM
Hi Ankur,
I created a BR on sc_req_item table and the above code has helped me.
When I close RITM all the attached CAtalog Tasks are closed as well.
Thanks for your help.
Manthan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-18-2020 03:32 AM
"Here when i close ritm state only 1 catalog task is closed, after closing 1st task 2nd is opened but not closed"
From your above statement it seems that when this BR runs there is only one task associated with RITM. ( you can check that in related list of RITM).
In this case only one task will be closed as only one task is associated with RITM at that point of time.
Raghav
MVP 2023