Hi dojo,
I tried to change an alarm template from one enhanced service by automation script, using the assign template action. This method shows an exception and this comment on logs:
How can I automatized this process?
Thanks!
Daniel Martinez [DevOps Advocate] Selected answer as best 11th April 2025
Hi Daniel,
For enhanced services you have to assign the template using the service reference. You can use the following code in your script:
var service = engine.FindService(“Service”);
var serviceInfo = service.ServiceInfo;
serviceInfo.ServiceElementAlarmTemplate = “Template1”;
var message = new AddServiceMessage
{
DataMinerID = serviceInfo.DataMinerID,
HostingDataMinerID = serviceInfo.HostingAgentID,
Service = serviceInfo,
};
engine.SendSLNetMessage(message);
Daniel Martinez [DevOps Advocate] Selected answer as best 11th April 2025
Understood Jorge.
Thanks!