Mirroring Field within Problem Table, into Problem Task Table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2023 02:52 AM
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:-
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
Would someone be able to help me with the correct script to fix this issue
Thank You
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2023 03:16 AM
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2023 03:30 AM
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
Thanking you for your assistance so far