Need to create a Request from a Change Record in the SOW and native view using a UI Action

Abhilasha G T
Tera Contributor

 

Hi Team,

 

I should be able to create a Request from a Change Record in the SOW and native view using a UI Action/Context Menu Action.

 

I have created UI action for native UI View and used the below script.

 

//Update saves incidents before going to the catalog homepage
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);
 
Able to create a request through change form, but under the related list tab >Request,  but not able to  establish the relationship between the original Change and the created REQ.
 
AbhilashaGT_0-1740474748379.png

 

AbhilashaGT_1-1740474826131.png

 

 

how to achieve this?

 

Regards,

Abhilasha G T

 

 

 

7 REPLIES 7

Hi @Abhilasha G T 

 

I understand your requirement, but the issue is why go in reverse? A change can be logged from a request, not the other way around. It’s better to discuss this again with the client to understand why this is required. Also, this would be a full customization, where you would need to build a new UI action, set that as a declarative action in WS, and then create a many-to-many relationship between the change and the request.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Ankur Bawiskar
Tera Patron
Tera Patron

@Abhilasha G T 

for the relationship you need to store the CHG sysId in REQ parent field

as per script you are using the "sysparm_parent_sys_id" so it should work

Is it not working from both native and workspace?

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

Hi Ankur,

I have created Request parent Mapping for Change Request, in request_parent_mapping.LIST

AbhilashaGT_0-1741267005956.png

its working fine now.

AbhilashaGT_1-1741267227835.png