- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2017 05:01 AM
I'm trying to auto populate the watchlist on an incident on assignment based on 2 things 1) the assigned group and 2) the priority of a call. This is going to be a business rule for us.
My code isn't working yet and because of rustiness I can't figure out where I've gone wrong. Appreciate the help on this
addToWatchList();
function addToWatchList() {
If (current.sys_user_group == 'TeamName') {
var wList = current.watch_list.split(',');
var addMe = current.u_escalation_assigned_to;
wList.push(addMe);
current.watch_list = wList.join(',');
current.u_escalation_assigned_to = '';
}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2017 05:06 AM
Hi Sean,
Please try this out and let me know
addToWatchList();
function addToWatchList() {
if(current.assignment_group.getDisplayValue() == 'TeamName') {
var watchlist = current.watch_list;
var addMe = current.u_escalation_assigned_to;
current.watch_list = watchlist + "," + addMe;
current.u_escalation_assigned_to = '';
}
}
Thanks
Please Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2017 05:06 AM
Hi Sean,
Please try this out and let me know
addToWatchList();
function addToWatchList() {
if(current.assignment_group.getDisplayValue() == 'TeamName') {
var watchlist = current.watch_list;
var addMe = current.u_escalation_assigned_to;
current.watch_list = watchlist + "," + addMe;
current.u_escalation_assigned_to = '';
}
}
Thanks
Please Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2017 05:09 AM
I have assumed that this is an on before business rule and you would be selecting the assignment group on incident as TeamName and u_escalation_assigned_to is a user reference field on your incident.
Thanks
Please Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2017 05:49 AM
Hi
Sean
iTried this on my dev instance write a on before business rule for this
(function executeRule(current, previous /*null when async*/) {
var cuser = current.assigned_to;//adding corresponding assigned to person and for caller replace this with caller_id
if ( current.watch_list.indexOf(cuser) == -1 )
{
var new_watch_list = current.watch_list.split(',');//+gs.getUserID(); //current.watch_list=current.watch_list+','+gs.getUserID();
new_watch_list.push(cuser);
current.watch_list = new_watch_list.join(',');
gs.addInfoMessage('user will be added to watch list succesfully');
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2017 12:36 AM
HI
may i know the status of ur thread in case if it is resolve then close the thread