- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-24-2016 09:43 PM
Hi all,
I have a Business rule which updates the request and request item watch list whenever the watch list for the catalog task is changed. This includes removing users from the watch list.
Table: sc_task
When to run: Before, Insert, Update
(function() {
//get the gliderecord for the parent request
var req = new GlideRecord('sc_request');
if (req.get(current.request)) {
req.watch_list = current.watch_list;
req.update();
}
//get the gliderecord for the parent request item
var reqitem = new GlideRecord('sc_req_item');
if (reqitem.get(current.request_item)) {
reqitem.watch_list = current.watch_list;
reqitem.update();
}
})();
This works great for single REQ/RITM/Tasks (which is all we have at the moment) however I can see the need for multiple tasks coming in the not too distant future, and would like to plan for that with any scripts i may be placing into the environment.
Does anyone know how I could approach this with the business rule above?
Cheers,
Brendan
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-01-2016 01:54 PM
Hi all,
I ended up going with using the request watch list on the catalog task form, and using the request watch list for all the notifications.
To get the request watch list onto the task form working properly, I needed to use parent.parent.watchlist, however I needed to create a BR that sets the REQ as the RITM's parent. Sometimes they don't make it easy.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-25-2016 12:34 AM
YOu have to write this above code of manoj in both queries.....1 to update sc_request and 2nd for sc_re_item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-24-2016 10:48 PM
Yes add the code to your existing code that will update all your tasks. If you have more than 1 RITM under 1 request then add a business rule on sc_req_item table to update all the RITMs under the current request.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-01-2016 01:54 PM
Hi all,
I ended up going with using the request watch list on the catalog task form, and using the request watch list for all the notifications.
To get the request watch list onto the task form working properly, I needed to use parent.parent.watchlist, however I needed to create a BR that sets the REQ as the RITM's parent. Sometimes they don't make it easy.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-13-2023 11:59 AM
I was able to use the code you did in your first post, and it work correct. But when a new task is created it wipes out my existing watchlist. Were you able to resolve this issue or do you know how I can do that on my end?
Thanks,
Jackie