How to grab parent sys id from catalog item url and set the parent field in request

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. Right now, we have the problem that the request completed is not linked to its parent or the incident. I noticed that the url of the forms that we get redirected to contains the parent sys_id. 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? Just needed help coding for that. Thank you.

 

3 REPLIES 3

Vishal Jaswal
Giga Sage

Hi @AM24 

The Out of the box Context Menu UI Action "Create Request" should do that for you. You can validate the same in your PDI. 

VishalJaswal_0-1752162050270.png

VishalJaswal_1-1752162083431.png

VishalJaswal_3-1752162134119.png

 



 

 


Hope that helps!

I believe I have pretty much the same code. I did notice that one catalog item form does correctly populate parent while others do not. I'm guessing some of these catalog items have some sort code that overrides the basic functionality?

Ankur Bawiskar
Tera Patron
Tera Patron

@AM24 

out of the box it gets linked when you use the OOTB UI action "Create Request"

REQ gets populated with the parent field as INC.

Please check if someone customized that

AnkurBawiskar_0-1752162390180.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