- 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 08:57 AM
@steveturley How are you creating RITM using record producer ? have you checked those variable rolled out to RITM ?
You can add log in BR to validate if you have variables value or not .
gs.log('Watch List '+ current.variables.user_to_be_added_to_watchlist.toString());
Thanks,
Harsh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2024 09:00 AM
The RITM's aren't being created via a Record Producer - only the Incident and that's working OK.
I thin the issue is that the user values from the update set aren't being passed to the RITM and I don't know why

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2024 09:02 AM
@steveturley Can you validate the log result ? check what exactly its giving you ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2024 09:27 AM
@steveturley Can you try this way ? Let me know what exactly do you see in log .
(function executeRule(current, previous /*null when async*/ ) {
gs.log('Watch List Details '+ current.variables.user_to_be_added_to_watchlist.toString());
if (current.variables.user_to_be_added_to_watchlist) {
gs.log('Yes i am in If block ' );
current.watch_list = current.variables.user_to_be_added_to_watchlist.toString();
}
})(current, previous);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2024 09:00 AM
I just tested this in my PDI and it is working fine. I went under the assumption that you are using a list collector field. If that is not correct let me know what type of field you are using.