- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2015 08:33 AM
Hi All!
I was hoping maybe someone encountered the same issue or would be able to help regarding watch list.
I currently have client script running to add specified email based on incident priority selected. However, once user chooses to change the priority - the existing watchlist is replaced with the new value defined in the client script.
What I would like it to do is:
1) Replace one email DL with another based on priority
AND
2) Copy all other users added to the watch list which not need to be replaced by the new value
I tried to modify the client script to copy existing value and replace just one of them, but I feel stuck
I hope I am making myself clear, but if no please let me know and I will try to be more detailed and specific
Thank you in advance!
Kamile
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2015 05:21 AM
Those should be fine. It is because I used the same variable names. You could change the names, or you could pull newWl up to the top and do this:
- var wl = g_form.getValue('watch_list');
- var newWl = '';
- if (newValue == 1 ) {
- if(wl.indexOf("email2@email.com") > -1){
- newWl = wl.replace("email2@email.com", "email@email.com");
- }else{
- newWl = wl + ",email@email.com";
- }
- /*var alist = g_form.getValue('watch_list');
- var arrlist = alist.split(",");
- arrlist.push("email@email.com");
- g_form.setValue("watch_list", arrlist);*/
- g_form.setValue("watch_list", newWl);
- }
- if (newValue == 2) {
- if(wl.indexOf("email@email.com") > -1){
- newWl = wl.replace("email@email.com", "email2@email.com");
- }else{
- newWl = wl + ",email2@email.com";
- }
- /*var alst = g_form.getValue('watch_list');
- var arrlst = alst.split(",");
- arrlst.push("email2@email.com");
- g_form.setValue("watch_list", arrlst);*/
- g_form.setValue("watch_list", newWl);
- }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2015 05:21 AM
Those should be fine. It is because I used the same variable names. You could change the names, or you could pull newWl up to the top and do this:
- var wl = g_form.getValue('watch_list');
- var newWl = '';
- if (newValue == 1 ) {
- if(wl.indexOf("email2@email.com") > -1){
- newWl = wl.replace("email2@email.com", "email@email.com");
- }else{
- newWl = wl + ",email@email.com";
- }
- /*var alist = g_form.getValue('watch_list');
- var arrlist = alist.split(",");
- arrlist.push("email@email.com");
- g_form.setValue("watch_list", arrlist);*/
- g_form.setValue("watch_list", newWl);
- }
- if (newValue == 2) {
- if(wl.indexOf("email@email.com") > -1){
- newWl = wl.replace("email@email.com", "email2@email.com");
- }else{
- newWl = wl + ",email2@email.com";
- }
- /*var alst = g_form.getValue('watch_list');
- var arrlst = alst.split(",");
- arrlst.push("email2@email.com");
- g_form.setValue("watch_list", arrlst);*/
- g_form.setValue("watch_list", newWl);
- }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2015 01:59 AM
Brilliant - this worked! Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2015 08:43 AM
Hi,
If its possible can you share your script or include it in a demo instance.
Venkat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2015 08:44 AM
Lets make sure of something first. You have separate distribution lists depending on the priority that want to be updated on every Comment to the Incident?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2015 08:52 AM
I have two separate DLs for two different priorities that need to be auto added (in total there are five priorities but others dont require DLs to be populated). When there is a change from critical to high priority, or viceversa, the two emails should switch places (and they do now) and keep all other users or emails added to the watch list (does not work).