Unable to specify user who acknowledged the alarm

In my module, I need to specify the user that acknowledged the alarm. In looking at SQL, it does not look like the ackUser is being captured at all. Below is my code:

ackUserName = 'test user'
EventData alarmEventData = new EventData();
alarmEventData.set(CommonAlarmProperties.AckUserName, ackUserName);
alarmEventData.set(CommonAlarmProperties.AckNotes, comment);
Set<UUID> notAcknowledgedAlarms = alarmManager.acknowledgeBulk(alarmIDs, alarmEventData);

I think I read somewhere that I should use alarmEventData.set(CommonAlarmProperties.AckUser, ); but I cannot figure out how to set AckUser instead

AckUser should be used, set with a QualifiedPath object that describes a username.

As in:

var ackUser = QualifiedPath.of(WellKnownPathTypes.User, ackUserName)
alarmEventData.set(CommonAlarmProperties.AckUser, ackUser);

AckUserName should be automatically derived from AckUser, so no need to set it yourself.

Works! Thank you!

1 Like