1. Cross-table GlideRecord update
“When an Incident is closed, update the Priority on every related Problem record to '2 - High'. How would you script it?”
How to answer
- Query problem records via the parent reference field, not by joining incident.
- Use setWorkflow(false) only if you must suppress notifications — defend the choice.
- Batch with autoSysFields(false) when bulk updating to keep audit clean.
Reference script
var pr = new GlideRecord('problem');
pr.addQuery('parent_incident', current.sys_id);
pr.query();
while (pr.next()) {
pr.priority = 2;
pr.update();
}Pitfall
Calling current.update() inside an after-business-rule on incident triggers recursion. Run this as a fix script or async BR, never sync after-update on the same row.