Re-import of an exported notification json file after modification imports successfully but uses the default payload template
search cancel

Re-import of an exported notification json file after modification imports successfully but uses the default payload template

book

Article ID: 398770

calendar_today

Updated On:

Products

VCF Operations/Automation (formerly VMware Aria Suite)

Issue/Introduction

  • Reimporting a notification rule with a modification of the name in the JSON file, results in the default payload template being set, instead of the custom payload template that was set in the original notification.  An example of this behavior is showing in the screenshots below:



    Observe that 'testsnow2' use the 'Default  Service-Now Notification Plugin', rather than the custom 'testsn' payload template. 

Environment

Aria Operations 8.18.x

Cause

This issue occurs if you only change the value for "Name" in the beginning of the file, and don't change the string under "ruleNameToTemplateNameMap" at the end of the file.

Resolution

  1. Sign into Aria Operations product UI
  2. Create a custom payload template for outbound plugins 
  3. Create a notification which utilizes the newly created payload template
  4. Export the notification as JSON file by navigating to Operations > Configurations > Notifications > Select the notification click on 3 dots > Click Export.
  5. Open the JSON file in a text editor like notepad   
  6. Edit the exported notification JSON file and change the two entries highlighted in red :
    {"NotificationRules":{"notificationRules":[{"NotificationRule":{"id":{"@UUID":"########-####-####-####-############","@ObjectType":"NOTIFICATION_RULE"},"Name":"testsnow2","Description":"","PluginID":{"@pluginType":"GenericRestPlugin-servicenow","@pluginName":"test"},"PluginType":"GenericRestPlugin-servicenow","entry":{"ConditionType":"ALERT_HEARTBEAT","NotificationRuleAlertHeartbeatCondition":{"sendHeartbeat":false}},"Disabled":false,"RuleType":"GENERAL_RULE"}}],"notificationTemplateDataSet":[{"NotificationTemplateData":{"id":{"@UUID":"########-####-####-####-############","@ObjectType":"NOTIFICATION_TEMPLATE"},"Name":"testsn","Description":"","pluginTypeId":"GenericRestPlugin-servicenow","notificationTemplateType":"GENERAL","metricKeysAndRelatedResourceKindKeys":[{"entry":{"ResourceKindKey":{"@resourceKind":"VirtualMachine","@adapterKind":"VMWARE"},"MetricKeysAndRelatedResourceKindKeys":{"metricKeysSet":[{"MetricKey":[{"nodeList":{"nodes":{"MetricKeyNode":[{"name":"cpu"},{"name":"20_sec_peak_iowaitPct"}]}},"isProperty":false},{"nodeList":{"nodes":{"MetricKeyNode":[{"name":"cpu"},{"name":"demandmhz"}]}},"isProperty":false},{"nodeList":{"nodes":{"MetricKeyNode":[{"name":"cpu"},{"name":"capacity_contentionPct"}]}},"isProperty":false}]}],"ancestorKindKeyMetrics":[""],"descendantKindKeyMetrics":[""]}}}]}}],"ruleNameToTemplateNameMap":[{"entry":{"string":["testsnow2","testsn"]}}]}}

  7. Save the file with a new name
  8. Import the modified JSON file back into Aria Operations by navigating to; Operations > Configuration > Notifications > Click on 3 dots to the right of ADD button > Select Import > Browse for the file > You can leave the default Skip import in case of conflict > Click on Import .  Example of notification after import showing in below screenshot