Populating an Alert Description with PropertyBag data

If you are running a script via a rule, and that script returns a propertybag, then it is possible you'll want the data returned to show up in the alert description assuming an alert is generated. The syntax for this in OpsMgr 2007 isn't that straight forward, but with some assistance we figured it out.

Here is what the proper syntax is for the alert description: $Data/Property[@Name='ret']$

Here is an example of the script that returns a PropertyBag
Set oAPI = CreateObject("MOM.ScriptAPI")
Set oBag = oAPI.CreatePropertyBag()
strReturn = "Test"
Call oBag.AddValue("ret",strReturn)
Call oAPI.Return(oBag)
Call oAPI.LogScriptEvent("TestScript.vbs", 9999, 0, strReturn)