Does anyone have a script or an example of attaching a note to an alarm when the AO emails someone on the alert?
Enclosing a script that will attach a note and log to the action.log the result of the EMAIL action. Note that you'll have to alter the AO profile from EMAIL to script.
-- email and log to action.log EMAIL result of operation
-- Uncomment 'recipient' if this is taken from the AO Script Parameter field.
-- testid can be used to test the script using an existing nimid.
--local recipient = SCRIPT_ARGS
--local testid ="OO37388187-77610"
local recipient = "email@example.com"
local a = alarm.get(testid)
local data = pds.create()
-- Add recipient
-- Add data from alarm
for k,v in pairs(a) do
local status = 1
local nimid = nimbus.post("EMAIL",data)
local task = "Sent to " .. recipient
if nimid ~= nil then status=0 end
action.note ("EMAIL-"..a.nimid, task.." with status: " .. status, a.nimid,true)
Retrieving data ...