- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
Hello.
We have a new user on the support team. How do I update an existing watchlist with this new user so he is notified when a new incident is created, or an existing incident is updated/closed?
Is there a way to do this without running a script?
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
That's great @Wayne DeCoste ,
Can you please mark the solution as accepted/helpful so that it helps future readers.
That will be much appreciated 🤗!
Shashank Jain
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello again.
Thanks for the update. What I am trying to do, is add a new team member to the incident watch list for all new incidents. So this likely wont do that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
@Wayne DeCoste , You can create business rule for that if you want to update on newly created incidents.
Shashank Jain
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Refer this for creating the business rule , it will update the newly created incident.
In the advanced condition add this code.
(function executeRule(current, previous /*null when async*/) {
var userToAdd = 'a8f98bb0eb32010045e1a5115206fe3a'; // Give the sys id of user you wanted to add.
var currentWatchlist = current.getValue('watch_list') || '';
var watchlistArray = currentWatchlist.split(',').filter(Boolean);
if (watchlistArray.indexOf(userToAdd) == -1) {
watchlistArray.push(userToAdd);
current.setValue('watch_list', watchlistArray.join(','));
current.update();
} else {
gs.print(gr.number + " already had the user in watchlist");
}
})(current, previous);
Note - It will add the user to the newly created incident watchlist after saving the record.
Shashank Jain
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
This will need scripting:
For old incidents:
var inc = new GlideRecord('incident'); // You can add query if yiu want to update a subset of incidents
inc.query();
while(inc.next())
{
inc.watchlist = inc.watchlist + ',' + 'sys_id of new user'; // verify and update the watchlist backend name
inc.update();
}
For new incidents: Create a before insert BR on incident table with below code:
current.watchlist = current.watchlist + ',' +'sys_id of new user'; // update watchlist backend name and sys_id value as per your req
Raghav
MVP 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello, thanks!
I found the system property hiaa.decisions.incidet_watch_list. In there I see the sys_id of the decision table it is pointing to.
Im trying to open the decision table using the URL: https://<your-instance>.service-now.com/sn_dt_decision_table.do?sys_id=<sys_id>. Replacing the instance and sys_id of the decision table. My thought is that I can add the sys_id of the user there.
But, I cant seem to open the decision table. Maybe my approach using the URL is not the right one to access the decision table?