Question: We have one problem under that we have multiple incident when problem get resolved then the child incident get resolved automatically.Means when parent get resolved the child incident should get resolved or closed automatically.
Object: Business Rule – After
Class: Glide Record
Script:
(function executeRule(current, previous / null when async / ) { // Add your code here gs.addErrorMessage('BR Run'); var gr = new GlideRecord('incident'); gr.addQuery('problem_id', current.sys_id); gr.query(); while (gr.next()) { gr.setValue('state', 6); gr.setValue('close_notes', 'Closed by Problem ' + current.number); gr.setValue('close_code', 'Resolved by problem'); gr.update(); } })(current, previous);
No responses yet