- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2022 06:41 AM
I am looking for a way to automatically generate an Outage record when Incident is created.
Aftre generate outage we need to set the 'Begin' & 'End' values from incident 'Actual start' & 'Actual end' fields.
Can any one help me on this requirement.
Solved! Go to Solution.
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2022 07:02 AM
Hi there,
This can be accomplished with an after insert business rule running on incident table. See below configuration:
Script:
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var outageGr = new GlideRecord('cmdb_ci_outage');
outageGr.initialize();
outageGr.setValue('task_number', current.getUniqueValue());
outageGr.setValue('type', 'outage');
outageGr.setValue('cmdb_ci', current.getValue('cmdb_ci'));
outageGr.setValue('begin', current.getValue('work_start'));
outageGr.setValue('end', current.getValue('work_end'));
outageGr.insert();
})(current, previous);
If this answer is helpful please mark correct and helpful!
Regards,
Christopher Perry
Regards,
Chris Perry

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2022 07:02 AM
Hi there,
This can be accomplished with an after insert business rule running on incident table. See below configuration:
Script:
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var outageGr = new GlideRecord('cmdb_ci_outage');
outageGr.initialize();
outageGr.setValue('task_number', current.getUniqueValue());
outageGr.setValue('type', 'outage');
outageGr.setValue('cmdb_ci', current.getValue('cmdb_ci'));
outageGr.setValue('begin', current.getValue('work_start'));
outageGr.setValue('end', current.getValue('work_end'));
outageGr.insert();
})(current, previous);
If this answer is helpful please mark correct and helpful!
Regards,
Christopher Perry
Regards,
Chris Perry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2022 08:29 AM
Thanks Christopher for quick turn, it works for me hence marking as correct
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-17-2022 07:20 AM
HI Chrisperry,
I have an additional Requirement for this
Upon Incident Resolution, the assignee will fill out Actual Start/Actual End fields on the incident form and these fields will be populated automatically on the Outage record.
For this i have created after business rule, and mentioned the condition -- current.incident_state.changesTo (6)
Script:
(function executeRule(current, previous /*null when async*/) {
var outageGr = new GlideRecord('cmdb_ci_outage');
outageGr.setValue('begin', current.getValue('work_start'));
outageGr.setValue('end', current.getValue('work_end'));
outageGr.setValue('type', current.getValue('u_outage_record_type'));
outageGr.update();
})(current, previous);
Am i missing here anything?
  
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2024 10:34 AM
Follow-up question on this thread: How do you ensure accurate Outage information (I couldn't see anything in the Xanadu release notes)?
As an IT Service Provider we are liable to potentially pay service credits and in some instances there can be quite severe implications where we fail to meet our Availability %'s. With such serious implications, you want accurate data and we know that where humans have to manually enter data, it is already at risk of not being accurate.
Has ServiceNow come up with a better solution since?