Event Management - Event Filed Mapping
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
13m ago
Hi,
I have created 1 custom fields on both event and alert table where using event rules to create an alert and event mapping field to handle complex mapping for fields.
The event rule is running fine and able to update the custom created field from event data (payload in addtional information), but event mapping field is unable to update any custom created record.
I tried updating the OOB field with the same parse value of given script and it is working but the moment I change it to custom field, It stops working ( still able to see the logs without any errors). PFB the event field mapping script and help me to fix it-
custom field name: u_quality_scores
script:
(function eventFieldMappingScript(eventGr, origEventSysId, fieldMappingRuleName) {
try {
var addInfoStr = eventGr.getValue('additional_info') || '{}';
var info = JSON.parse(addInfoStr);
gs.info('[' + fieldMappingRuleName + '] quality_score raw value: ' + info.quality_score);
if (info.quality_score != null) {
var score = parseInt(info.quality_score, 10);
if (!isNaN(score)) {
eventGr.setValue('u_quality_scores', parseInt(score + 1));
return true;
// gs.info('[' + fieldMappingRuleName + '] Set u_quality_scores to ' + (score + 1));
}
}
return true;
} catch (e) {
gs.error("The script type mapping rule '" + fieldMappingRuleName + "' ran with the error: \n" + e);
return false;
}
})(eventGr, origEventSysId, fieldMappingRuleName);
0 REPLIES 0
