Set default Watch list in the Catalog Item

Kamali3
Kilo Contributor

Hi,

I have catalog item, where I need to sent send notification based on the selected request type

Lets say if the request type - New/ change

if new

Watch list - A & B

If Change

Watch list - C & D

This watch list field needs to be hidden for End user's

Watchlist - List collector(sys_user)

 

 Can some one help with the client script to set these values by default based on request type?

 

 

 

 

 

1 ACCEPTED SOLUTION

Saurav11
Kilo Patron
Kilo Patron

Hello,

Is the watchlist field a variable on the catalog item or a field on RITM.

If it's a field on RITM you can use a BR or a run script in the workflow itself as below:-

 var request=current.variabales.request_type;

if(request=='new')

{

current.watch_list='enter sys_id of the suers comma seperated';

current.update();

}

Please mark answer correct/helpful based on Impact

 

View solution in original post

4 REPLIES 4

Voona Rohila
Kilo Patron
Kilo Patron

Hi kamali

You want to set watchlist values for your RITM based on variable values?


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

Just configure it in your workflow if this requirement is for single catalog item.

1. Write a run-script after begin activity,use below code to map watchlist values.

2. Store the users sys_id's in a property and use getproperty to get the values.

var request=current.variabales.request_type;

if(request=='new')

{

current.watch_list= gs.getProperty('property1'); //property1 stores users sysid's

}
else
{
current.watch_list= gs.getProperty('property2');//property2 stores users sysid's


}

Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

Abhijit4
Mega Sage

Hi,

Client scripts are preferred only when we want to show something to user based on some action. In your case watchlist is hidden for users then better to go for BR.

You could write BR on RITM table and check for request type variable value and set watchlist value.

Let me know if you have any further queries.

Please mark this as Correct or Helpful if it helps.

Thanks and Regards,
Abhijit

By marking my response as correct or helpful, you contribute to helping future readers with similar issues.
Regards,
Abhijit
ServiceNow MVP

Saurav11
Kilo Patron
Kilo Patron

Hello,

Is the watchlist field a variable on the catalog item or a field on RITM.

If it's a field on RITM you can use a BR or a run script in the workflow itself as below:-

 var request=current.variabales.request_type;

if(request=='new')

{

current.watch_list='enter sys_id of the suers comma seperated';

current.update();

}

Please mark answer correct/helpful based on Impact