Trigger SQL Agent job based on text in error log for an AG failover
You need to select &lt;all databases&gt; in the database name selection.  The error you are checking for is not related to a specific database, so having a database specified is effectively filtering it so the alert doesn't care about it.

I just tested this using RAISERROR to log a message that included "'this' or 'that'" and it worked fine.  At first I thought you may need to delimit the single quotes, but in my test I didn't and it worked.