Is there a way to trigger an action from a notification? I am trying to get MS Teams notifications as triggers.
Unfortunately not really. I don't think the system is sending any events when such a notification happens. You could have a script that periodically checks, but that would not react immediately.
it's a pity. Tasker app for Android allows that, it's super useful everyday tool