So I’m trying to update the alarm assgination, state and priority from a custom plugin. And I’ve come across the following, if I use the UpdateAlarm method, multiple updates are being made instead of a single one each time I fill the parameters. Therefore updates get replicated in other fields.
To solve this I have tried using the UpdateAlarmValues, and tried feeding what I believe to be the correct values. However, when changing the assigned user, it fails to change it in the given alarm but it is written in the history as a comment. The same happens with both Int and Name values for state and Priority, which get field in the KeyValuePair array but fail to update the alarm and also fail to get registered in the history.
(Example of the array, where priorityId and priorityName are a ushort and string extracted from the APIRest service. Below there’s the method I use to save the values.)
var values = new KeyValuePair<string, string>[]
{
new KeyValuePair<string,string>( “PriorityId”,priorityId.ToString()),
new KeyValuePair<string,string>( “PriorityName”,priorityName),
};
AlarmClientManager manager = new AlarmClientManager();
IAlarmClient client = manager.GetAlarmClient(EnvironmentManager.Instance.MasterSite.ServerId);
client.UpdateAlarmValues(_alarm.EventHeader.ID, values);
