What values are expected by the AlarmClient.UpdateAlarmValues?

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);

I think the UpdateAlarm method holds the parameters we have envisioned to be used most often.

Ref. https://doc.developer.milestonesys.com/html/index.html?base=miphelp/interface_video_o_s_1_1_platform_1_1_proxy_1_1_alarm_client_1_1_i_alarm_client.html&tree=tree_search.html?search=updatealarmvalues

Please note that “PriorityId” does not exist (PriorityInt does).

An example of values can be seen in the Management Client.

Alarm Priorities can also be read with the Alarm Rest API -

https://doc.developer.milestonesys.com/mipvmsapi/api/alarms-rest/v1/#tag/Alarm-Priorities

Awesome, what about the users. We’re trying to changed the assigned user, however, we haven’t really found a way to set it right. We tried with the name and DisplayName with no luck, how should I get the user list, and what are you expecting for them to be assigned?

It is possible via Configuration API to read the roles defined in the server. To find which roles are allowed to see the alarm and the source item of the alarm. Then to find the users that belong to those roles. Those users are the ones that could be good candidates as assigned users.

We already found that way to get the users, however, when changing the assignee for the alarm and uodating the values, the history is updated but the assigned user is not saved. Do I have to feed any specific user id ? The name just makes it print a line in the history but does nothing. Also, UpdateAlarmvalues seems to work asyncronously but the method is syncronous in the SDK, so when updating there’s times I don’t get the new lines and they appear in subsequent updates.