How to populate parent field on change while creating standard change from incident

Praneeth8
Tera Contributor

Hello Everyone,

I have created the standard change from the incident. but the parent field on the change form is not populated with incident sys id. I know there is an OOB UI action that calls OOB script include for standard change StdChangeUtils().getURLForTask(current, 'rfc') . This StdChangeUtils extends the OOB StdChangeUtilsSNC script include which is read-only. I am not sure where to edit the script to populate the parent field on the change form. can anyone suggest how to achieve this requirement?

9 REPLIES 9

Mohit Kaushik
Mega Sage
Mega Sage

Hi Praneeth,

Since it is not a good practice to Update OOB scripts, so I would suggest you can create a business rule on incident table, which should run as below:

When : After, Update

Filter condition: Change Request | Changes and Not empty.

In the script section you can write something like this:

var change = new GlideRecord('change_request');
change.get(current.rfc);
change.parent = current.sys_id;
change.update();

 

Please mark this as correct and helpful if it resolved the query or lead you in right direction.

Thanks,
Mohit Kaushik
Community Rising Star 2022

Thanks,
Mohit Kaushik
ServiceNow MVP (2023-2025)

Hi Mohit, 

Thanks for reply.

I have tried with after business rule but it is not working so i have used Display business rule it is worked. but using display business rule updated values(parent field is updated) will show up to form level only. so the parent field in the list view still empty. Is there any better way to achieve this ??

Hi Praneeth,

Can you share the details of BR. It should ideally work with a before business rule.

Regards,
Deepankar Mathur

Hi Praneeth, 

can you please show the details of your BR so that I can help you with that.

 

Thanks,
Mohit Kaushik
Community Rising Star 2022

Thanks,
Mohit Kaushik
ServiceNow MVP (2023-2025)