from com.inductiveautomation.ignition.common.alarming.config import CommonAlarmProperties
startTime = system.date.addHours(system.date.now(), -16)
endTime = system.date.now()
allAlarmData = system.alarm.queryJournal(journalName='Wilson_AJ', startDate=startTime, endDate=endTime, source=['prov:WILVAC14:/tag:TrailerTracking/Alerts/*'],includeSystem=False)
alarmRecord = allAlarmData[0]
alarmLabel = alarmRecord.label
alarmlabel = alarmRecord.get(CommonAlarmProperties.Name)
alarmlabel = alarmRecord.get(CommonAlarmProperties.Label)
alarmlabel = alarmRecord.get(CommonAlarmProperties.DisplayPath)
alarmName = alarmRecord.name
alarmDisplayPath = alarmRecord.displayPath
return alarmLabel
I am referencing the alarm journal using system.alarm.queryJournal().
When I reference the alarmRecord.label property or try to use .get(CommonAlarmProperties.Label), it only returns the name of the alarm. In this case 'MissedEntry'.
I tried using each of the highlighted lines in the picture, but they all return the same thing 'MissedEntry', which is the alarm name.
In my Alarm Journal component in views, the Label column shows the correct label. But when I use this query in scripting, none of the properties seem to return the label.
Let me know if there's a way to fix this. I can get the name at alarmRecord.name property and I can get the display path at alarmRecord.displayPath, so I can change the way my alarms are set up to put my label text in the display path instead. But there doesn't seem to be a way to retrieve the label property.
Thanks!