Coping of work notes and comments from parent incident ticket to child incident ticket?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2016 02:48 AM
When we are creating any child ticket under the parent incident , then all the work notes and comments of parent incident should copy to the activity log of child incident.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2016 03:04 AM
Hi Sanchita,
You can create business rule for this.Refer the OOB BR 'Update Child Incidents' for this ...adjust your conditions according to your requirement.
Mark Correct if it solved your issue or hit Like and Helpful if you find my response worthy.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2016 03:21 AM
Hi Sanchita,
There is a OOB Business Rule available in the Incident table named 'Update Child Incidents' This business rule works after update and also updates the Work notes and Comment to the Child Incident.
Please do the required modification in the script and condition according your requirement and create a new Business Rule before Insert as per your query.
I hope this helps.Please mark correct/helpful based on impact
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2016 11:25 AM
Here's a bit of code that might help. (from the oob code, your issue may be that you created a new parent incident field that needs to be updated)
updateChildIncidents();
function updateChildIncidents() {
updateChildren('comments', 'Comment copied from Parent Incident');
updateChildren('work_notes', 'Work note copied from Parent Incident');
}
}
function updateChildren(fieldName, msg) {
msg = gs.getMessage(msg);
var rec = new GlideRecord("incident");
rec.addQuery("parent_incident", current.sys_id);
rec.addQuery("incident_state", "!=", IncidentState.RESOLVED);
rec.addActiveQuery();
rec.query();
while (rec.next()) {
var fieldRawValue = current.getValue(fieldName) + '';
var fieldValue = fieldRawValue.trim();
if (!fieldValue || fieldValue.length <= 0)
return;
if (fieldRawValue.indexOf(msg) == 0)
rec[fieldName] = fieldRawValue;
else
rec[fieldName] = msg + ": " + fieldRawValue;
rec.update();
}
}