Link an Request to an Incident and have it populate in a related list
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2025 03:03 PM
I have a Incident. I use the Create Request UI action to create a new request. It directs to Service Catalog forms from which I can create a request. What would be the steps to link this request to than incident? How would I get this request linked to that incident so it would show up in an embedded related list?
This is the code used for the Create Request UI action so far:
current.update();
var url;
var activeCatalogsCount = sn_sc.Catalog.getCatalogCount();
if (activeCatalogsCount === 1) {
url = "catalog_home.do?sysparm_view=catalog_default&sysparm_parent_table=" + current.sys_class_name + "&sysparm_parent_sys_id=" + current.sys_id;
}
else {
url = "catalogs_home.do?sysparm_view=catalogs_default&sysparm_parent_table=" + current.sys_class_name + "&sysparm_parent_sys_id=" + current.sys_id;
}
action.setRedirectURL(url);
This is the embedded related list that the new requests should show up in.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2025 03:27 PM
I suggest that you look at existing OOB UI Actions that create records in a table. Such as UI Action 'Create Case' defined on the 'sn_customerservice_case' table. Your script above does not create a record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2025 04:49 PM
@AM24 if your catalog item is a record producer then try this
var request = producer.request; // current request
request.incident = request.getParameter('incident'); // Pass via URL
request.update();
Regards,
Prasanna
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-02-2025 10:34 AM
Where would I use this code? With the Create Request Action, I get taken to two catalogs from where I have several different requests.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-02-2025 08:47 PM
You can try
1.By adding reference feild on request table with the reference as incident
2.Modify UI action on incident form
var incId = g_form.getUniqueValue();
var url = '/com.glideapp.servicecatalog_cat_item_view.do?sys_id=CATALOG_ITEM_SYS_ID&incident=' + incId;
window.open(url, '_blank');
3. In the catalog item script, after item submission set the request incident field
var incId = g_form.getUniqueValue();
var url = '/com.glideapp.servicecatalog_cat_item_view.do?sys_id=CATALOG_ITEM_SYS_ID&incident=' + incId;
window.open(url, '_blank');
4. Configure the releated list on incident form
Regards,
Prasanna