- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2024 08:42 AM
I've been using a Variable Set to allow our users to add other users of their choice to the watchlist of Request Items and Incident (via a Record Producer)
This was working fine and still does for incident, but now the code for RITM doesn't work. The script for the business rule to add the user to the RITM is below. Tbh, the user value doesn't seem to be being passed to the RITM anymore.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2024 09:47 AM
Got it! Discrepancy between my variable name and my business rule.
Gaaaaaaaaaaaaaaaaaaaaaaaaaah.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2024 09:27 AM
Oh wait you script should look like this.
(function executeRule(current, previous /*null when async*/ ) {
gs.log('in business rule');
if (current.variables.user_to_be_added_to_watchlist) {
gs.log('in if');
current.watch_list = current.variables.user_to_be_added_to_watchlist;
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2024 09:33 AM
So updated my script and I get three log entries that look like this

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2024 09:38 AM
Interesting that it is calling multiple times. What is the order set to on your BR. It is usually found under the dropdown where you choose if it is before or after br.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2024 09:39 AM
It's 'before' and the order is 100
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2024 09:42 AM
I don't really understand why this isn't working because I have it working in another instance.