Update child incident based on parent incident

Rishi32
Tera Contributor

Hi All,

Need get all the filed values to child incident from parent incident. Child incidents also having child incidents, update field value only to child incidents under direct parent incident(parent-->child)not to child incidents which are under child incidents(parent-->child-->child). Could anyone help me how to achieve this.

 

Thanks in Advance

Rishi

3 REPLIES 3

Prasad Dhumal
Mega Sage
Mega Sage

Configure After Business Rule

(function executeRule(current, previous /*null when async*/) {
  //Get parent incident
  var gr = new GlideRecord("incident");
  gr.addQuery("parent_incident", current.sys_id);
  gr.query();
  gs.addInfoMessage("parent incident = " + current.sys_id); //for testing
  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.setValue("impact", '3');
    gr.setValue("urgency", '3');
    gs.addInfoMessage("cmdb ci = " + cmdb_ci);
    gs.addInfoMessage("current cmdb ci = " + current.cmdb_ci);
    gr.update();
  }
})(current, previous);

MattiasJonsson
ServiceNow Employee
ServiceNow Employee

There is a UI Action called "Create Child Incident" that looks at the "Incident Management Properties" for what to copy.

DOCS

OOB, for instance Parent Notes/Work Notes will flow to Child Incidents.

 

There's also a similar Business Rule that syncs States between Parent & Child

DOCS

 

Also, you can probably do this with a Flow in Flow Designer that triggers on for instance Incident Update, looks up Child Incidents and updates all changed fields from Parent to Child.

 

If correct or helpful, please indicate so!

 

 

Sanika Subhash
Tera Expert

Hey Rishi,

You can create child incident from parent by using UI Action. Check below link which describe "how to create child incident via Button".

https://video.search.yahoo.com/search/video;_ylt=Awr9Hr5vmaRgYnkAamWJzbkF?p=create+child+incident+fr...

Also refer below document if required.

https://docs.servicenow.com/bundle/quebec-it-service-management/page/product/incident-management/tas...

 

Please mark it as correct and helpful.

Thank you,

Sanika Gaikwad