Hello,
I’m hoping someone can help me out. I’ve configured Cookdown Connection center for bidirectional flow between SCOM and ServiceNow. Now I’m trying to reflect the SCOM alert owner details in the ‘Assigned to’ field in a ServiceNow Incident. The default script can use the ‘Assigned to’ details to update Owner details in SCOM, but I’m struggling to find a way to do it the other way around.
(function updatescomAlert(incidentRecord, scomAlertRecord, scomAlertUpdatePayload) {
// The incident connected to this alert is available as incidentRecord
// The SCOM alert is available as scomAlertRecord
// The alertUpdates object is available to update any SCOM properties// The alertId is used to link this to the alert in SCOM, don’t change this unless you know what your doing
// TYPE: string
scomAlertUpdatePayload.AlertId = scomAlertRecord.alertid.toString();// TYPE: string
scomAlertUpdatePayload.TicketId = incidentRecord.number.toString();// TYPE: string
scomAlertUpdatePayload.CustomField1 = incidentRecord.assignment_group.getDisplayValue();// TYPE: string
scomAlertUpdatePayload.CustomField2 = incidentRecord.business_service.getDisplayValue();// TYPE: string
scomAlertUpdatePayload.CustomField3 = incidentRecord.cmdb_ci.getDisplayValue();// TYPE: string
scomAlertUpdatePayload.CustomField4 = incidentRecord.state.getDisplayValue();// TYPE: string
// scomAlertUpdatePayload.CustomField5 = “Custom field data”// TYPE: string
scomAlertUpdatePayload.Owner = incidentRecord.assigned_to.getDisplayValue();// TYPE: int
// if(scomAlertRecord.resolutionstate != 255){
// scomAlertUpdatePayload.ResolutionState = 254;
//}
})(incidentRecord, scomAlertRecord, scomAlertUpdatePayload);
I’m not familiar with Java script, but I tried using this in script: “incidentRecord.assigned_to = scomAlertUpdatePayload.Owner;”, which didn’t work. I would appreciate for suggestions or workarounds.
Also, I’m wondering if it’s possible to use the Alert History Comments as Notes in the ServiceNow incident.
Thank you!