Link an Request to an Incident and have it populate in a related list

AM24
Giga Guru

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.

AM24_0-1751407145597.png

 

7 REPLIES 7

Say the catalog item form has a url with the parent id, is there any way I would grab that and associate the new request with that url upon submission? The urls seem to have the parent id as in the form of "&sysparm_parent_sys_id=622abc2383837cc". Could I grab that and when the new request is submitted, the parent would be set to that id or incident?

Santosh Oraon
Tera Expert

Hi @AM24 , If you want to show in a embeeded list then Create a reference field in request table that will be reference to incident table. So when you click ui action update that field value with your incident number you will be able to see the linked request.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards
Santosh

Ankur Bawiskar
Tera Patron
Tera Patron

@AM24 

the OOTB Create Request redirects to native service catalog and when REQ is generated it has parent set with INC record. this happens by default

That helps creating the relationship between INC and REQ

AnkurBawiskar_0-1751427520739.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader