Alarm Summary - filter to only display one priority of alarm

I can see a min priority to display on the alarm summary object. I need to only display 1 priority eg Medium. I think I should be able to do this using the filterAlarm() script but cant see how to get it to work. Can you help please

try this is filterAlarm:

return alarmEvent.get('priority').intValue == 2

return alarmEvent.get(‘Label’) ==“stringtag”).value
How Can I use this filter for searching by part of word only? (window scripting filteralarm).