- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2022 12:16 AM
In child incident if category, sub category, configuration item, state, priority, etc changes, that updated data should populate in parent incident. So parent incident is updated according to child.
Please help me to do this.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2022 12:35 AM
Hi @Nihar2
Create after update BR on incident form as below :-
Script :-
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var parentGr = new GlideRecord("incident");
parentGr.addQuery('sys_id', current.parent_incident);
parentGr.query();
if (parentGr.next()) {
parentGr.cmdb_ci=current.cmdb_ci;
parentGr.category=current.category;
parentGr.subcategory=current.subcategory;
parentGr.assignment_group = current.assignment_group;
parentGr.impact=current.impact;
parentGr.urgency=current.urgency;
parentGr.update();
}
})(current, previous);
Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2022 12:27 AM - edited 12-23-2022 12:42 AM
Hello Nihar,
Design an after BR and under the Advance Tab , Include below Script also If you want to Include few more fields follow the Same process
var gr = new GlideRecord("incident");
gr.addQuery("parent_incident", current.sys_id);
gr.query();
while (gr.next()) {
// Setting values to match parent
gr.setValue("cmdb_ci", current.cmdb_ci);
gr.setValue("category", current.category);
gr.setValue("subcategory", current.subcategory);
gr.setValue("assignment_group", current.assignment_group);
gr.update();
Mark solution as correct/helpful if this helped
Regards,
Shyamkumar
Regards,
Shyamkumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2022 12:35 AM
Hi @Nihar2
Create after update BR on incident form as below :-
Script :-
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var parentGr = new GlideRecord("incident");
parentGr.addQuery('sys_id', current.parent_incident);
parentGr.query();
if (parentGr.next()) {
parentGr.cmdb_ci=current.cmdb_ci;
parentGr.category=current.category;
parentGr.subcategory=current.subcategory;
parentGr.assignment_group = current.assignment_group;
parentGr.impact=current.impact;
parentGr.urgency=current.urgency;
parentGr.update();
}
})(current, previous);