Mirroring Field within Problem Table, into Problem Task Table

AAMProd
Tera Contributor

Seeking Help on a client requirement, I am new to ServiceNow and Scripting is something I am weak at.

 

I am creating a business rule whereby the business_service field in Problem Table, needs to be mirrored into the Problem Task table.

 

So when customer inputs a value into the business_service field of Problem Table, this needs to be mirrored in the same field under Problem Task Table.

 

So Far this is what I have as script:-

AAMProd_0-1700045323386.png

 

Please see screenshots for further details

 

I want to take the below reference field, and when user selects an option this needs to update the same field under Problem Task Table

AAMProd_1-1700045388431.png

AAMProd_2-1700045498146.png

 

Would someone be able to help me with the correct script to fix this issue

 

Thank You

 

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@AAMProd 

any reason why to have same field on problem task?

you can simply dot walk and add that field on problem task form

update your script as this

var gr = new GlideRecord("problem_task");
gr.addQuery("problem", current.sys_id);
gr.query();
while (gr.next()) {
	gr.business_service = current.business_service;
	gr.update();
}

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,

 

Unfortunately the above solution is not working, when I create a new problem task it is still not populating the business_service field.

 

Please see screenshots for further assistance. Please advise if I have missed anything

 

AAMProd_0-1700047777077.pngAAMProd_1-1700047802231.png

AAMProd_2-1700047826930.png

 

Thanking you for your assistance so far