filterAlarm against alarmEvent.get('source') vs alarmEvent.get('name')

I can see the alarmEvent on the console just fine. There is the source property that would like to do a contains against.

The below works fine:
testSt = alarmEvent.get(‘name’)
system.perspective. print(testSt)
if testSt.contains(“Sample_Tags”):
system.perspective. print(“Yes”)
else:
system.perspective. print(“No”)
return False

When I change to use ‘source’ vs ‘name’:

testSt = alarmEvent.get(source)
system.perspective. print(testSt)
if testSt.__contains__("Sample_Tags"):
   system.perspective. print("Yes")
else:
   system.perspective. print("No")
return False

I get the following error:

com.inductiveautomation.ignition.common.script.JythonExecException
Traceback (most recent call last):
File “function:filterAlarm”, line 9, in filterAlarm
AttributeError: ‘com.inductiveautomation.ignition.common.QualifiedP’ object has no attribute ‘contains

caused by org.python.core.PyException

Traceback (most recent call last):
File “function:filterAlarm”, line 9, in filterAlarm
AttributeError: ‘com.inductiveautomation.ignition.common.QualifiedP’ object has no attribute ‘contains

Ignition v8.1.13 (b2021122109)
Java: Azul Systems, Inc. 11.0.13

I want to only permit a certain source to update the alarm table. Thanks in Advance!

event.source is not a string, it’s a QualifiedPath object.
You can call toString() or toStringSimple (mentioned in the link above) or wrap it in str (a Python builtin) to convert it to a string, or, potentially, use one of the richer object methods detailed above.