- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2022 06:10 AM - edited ‎11-01-2022 06:30 AM
Hi guys,
I got two variables in service catalog,
incident created: ref type
watchlist: list collector
I want to autopopulate the watchlist based on the incident record that i choose. Can i get some hints or sol for this
thank you
Solved! Go to Solution.
- Labels:
-
Incident Management
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2022 07:46 AM - edited ‎11-01-2022 07:48 AM
Hi @rakesh8 ,
Try the below client script code on change of your incident variable:
var inc= g_form.getReference('your_incident_variable_name', populateWatchList);
function populateWatchList(inc) {
g_form.setValue('your_watch_list_variable_name', inc.getValue("watch_list");
}
I hope this help.
Please mark this helpful if this helps and Accept the solution if this solves your issue.
Regards,
Kamlesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2022 09:08 AM - edited ‎11-01-2022 09:09 AM
@rakesh8 I am glad, it helped. Below inline is the explanation of code used.
var inc= g_form.getReference('your_incident_variable_name', populateWatchList); //Get the reference of the selected incident record Asynchronously and pass it to the 'populateWatchList' callback function
function populateWatchList(inc) {
g_form.setValue('your_watch_list_variable_name', inc.getValue("watch_list"); //Inside the callback function we are retreiving the value of the selected incident's watchlist field and populating the watchlist variable of the catalog item.
}
I hope this helps.
Regards,
Kamlesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2022 09:14 AM
Thank you so much ^^
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2022 07:51 AM - edited ‎11-01-2022 07:52 AM
1.Create an onchange client script on change of incident.
2. Use below script:
var incRecord = g_form.getDisplayBox('incident backend name').value;
g_form.setValue('watch_list' backend name', incRecord );
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2022 08:43 AM - edited ‎11-01-2022 08:47 AM
Its not working @Manal Aquil . i applied what you said in the catalog client script with on change variable as incident created
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2022 08:51 AM - edited ‎11-01-2022 08:52 AM
@rakesh8 I don't see you are using below script :
var incRecord = g_form.getDisplayBox('incident_created').value; g_form.setValue('watchlist', incRecord );
Mark helpful if it works