Alarm filter with associated data

I am filtering my alarms with associated data and it works very well for the alarm client. My problem is that I created a SA alarm severity indicator and used the following script to find the number of active alarms:

runScript(“len(system.alarm.queryStatus(priority = [‘High’],state = [‘ActiveUnacked’,‘ActiveAcked’]))”, {Alarm Severity Ind.UpdateRate})

I need to be able to filter this data with my associated data, but there doesn’t seem to be a parameter for this in the script. I thought about querying the alarm database directly, but I am not certain exactly how to do that either. Any help would be much appreciated!

I hope this helps