Hey folks,
Apologies if this has been asked elsewhere, but if it has I haven't been able to find it!
I am trying to set up a trigger alert email with a variable recipient based on the machine name in the alert. For example, our naming convention means that any server name containing 'APP' should go to the Apps mailing list - this is set up in a Group custom property.
So, in SWQL the following works happily, retuing an email address (or blank if I tweak the CharIndex):
select (case when CharIndex('APP', 'LVPAPP004') > 0 THEN G.CustomProperties.GIB_Email_Alert ELSE '' END) AS Blah from Orion.Groups G where G.Name = 'Apps_Daytime'
However, when I put this in the Recipients field in an alert action (replacing the name with the machine name variable, I get an error:
${N=SWQL;M=select (case when CharIndex('APP', ${N=SwisEntity;M=Name}) > 0 THEN G.CustomProperties.GIB_Email_Alert ELSE '' END) AS GIB_Email_Alert from Orion.Groups G where G.Name = 'Apps_Daytime'}
I have tried simplifying this down to the following, but these still fail:
${N=SWQL;M=select (case when 5 > 0 THEN G.CustomProperties.GIB_Email_Alert ELSE '' END) as GIB_Email_Alert from Orion.Groups G where G.Name = 'Apps_Daytime'}
${N=SWQL;M=select (G.CustomProperties.GIB_Email_Alert) as GIB_Email_Alert from Orion.Groups G where G.Name = 'Apps_Daytime'}
This, however, works:
${N=SWQL;M=select G.CustomProperties.GIB_Email_Alert as GIB_Email_Alert from Orion.Groups G where G.Name = 'Apps_Daytime'}
So, it looks to me like the SWQL code in the receipents list has significant limitations compared to the SWQL available in the message body (where all of the above work happily). Has anyone else found this, and does anyone know of a workaround?
Thanks,
Richard