- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-26-2017 04:02 PM
I am trying to check if Opened By has the role "snc_internal" and if so add them to the Watchlist.
My guess is that my script isn't correct but I don't have much experience with scripting. Any help would be great.
Solved! Go to Solution.
- Labels:
-
Customer Service Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2017 01:33 PM
I figured out my issue. The watchlist that I see on my "case" record is actually on Task which is in global. I was creating the business rule under case so I wasn't able to get access to watch_list and the editor wasn't telling me this was a problem unless I typed current. and could see that it wasn't available. Changing scope fixed this right up.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-26-2017 04:12 PM
Hi Chris,
check if watchlist name is as below
var wlist = current.watch_list;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2017 05:13 AM
Servicenow uses '_'(underscore between names). Check your fieldname
var wlist = current.watchlist; // replace to var wlist = current.watch_list;
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2017 07:24 AM
I gave that a shot, doesn't seem to work.
1. If I type current. should I see the option for watch_list? I'm used to Visual Studio but maybe SN doesn't work the same.
2. I also removed the condition for role to see if I could simply get it to work without checking the user role. No luck.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2017 01:33 PM
I figured out my issue. The watchlist that I see on my "case" record is actually on Task which is in global. I was creating the business rule under case so I wasn't able to get access to watch_list and the editor wasn't telling me this was a problem unless I typed current. and could see that it wasn't available. Changing scope fixed this right up.