# Getting alarm acknowledgement notes into acknowledge email

**URL:** <https://forum.inductiveautomation.com/t/getting-alarm-acknowledgement-notes-into-acknowledge-email/77091>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [July 28, 2023, 9:52pm UTC](https://forum.inductiveautomation.com/t/getting-alarm-acknowledgement-notes-into-acknowledge-email/77091 "2023-07-28T21:52:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Benji\_Park](https://avatars.discourse-cdn.com/v4/letter/b/5f9b8f/32.png) [@Benji\_Park](https://forum.inductiveautomation.com/u/Benji_Park)\
**Post date:** [July 28, 2023, 9:52pm UTC](https://forum.inductiveautomation.com/t/getting-alarm-acknowledgement-notes-into-acknowledge-email/77091/1 "2023-07-28T21:52:23Z")

</div>

What I'm attempting to do is get the acknowledgement notes from the most recently acknowledged alarm and include it in the body of the acknowledgement email. I have two pipelines set up. One is the active pipeline and one is the ack pipeline. When an alarm is acknowledged, it sends out an email with this as the body: "At {eventTime|hh:mm:ss}, alarm "{name}" at "{displayPathOrSource}" was acknowledged by {ackUserName}."

I've been requested to attach what was said by the acknowledger. I found this forum post that lets me get acknowledgement notes but I can't figure out how to get this information into my acknowledgement email.

> [@Get Acknowledgement Notes](https://forum.inductiveautomation.com/t/get-acknowledgement-notes/65249/6):
>
> I did see the note listed in the alarm banner, I'm just having problems retrieving it via script.

When I run this script from the script console, I get the ackNotes from the specific alarm.

```auto
queryResult = system.alarm.queryStatus(path="*"+"Filter4"+"*",state=['ClearAcked'])
notes = queryResult[2].getAckData().get(CommonAlarmProperties.AckNotes)
print(str(notes))

```

When I try to get this same code to run in the alarm pipeline, I get "null". (I know this isn't the most recent alarm but one step at a time. Getting the ackNotes from any alarm lets me move to solving the next step of getting it from the most recent alarm.)

I've tried putting the script in a script block in the pipeline before the email gets sent and putting the variable in the email body but that didn't work. I've also tried using set property block to set a variable with the script but that didn't work either.

Am I going about this wrong or missing something? I'm still learning so I'm probably ignorant or overlooking something obvious.

---

<div class="post-metadata">

**Author:** ![aaronrai24](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/aaronrai24/32/87248_2.png) [@aaronrai24](https://forum.inductiveautomation.com/u/aaronrai24)\
**Post date:** [July 29, 2023, 5:55am UTC](https://forum.inductiveautomation.com/t/getting-alarm-acknowledgement-notes-into-acknowledge-email/77091/2 "2023-07-29T05:55:30Z")

</div>

Maybe try using the `event` object that's available in script blocks in the alarm pipeline([Scripting Object Reference](https://docs.inductiveautomation.com/display/DOC81/Scripting+Object+Reference)). This object has ackData which returns information regarding the acknowledgement of the event. Here's an example of the script I used and its output:  
In the script block:

```auto
def handleAlarm(event):
  logger = system.util.getLogger('Alarm Test')
  logger.info('Alarm acked')
  logger.info(str(event.ackData))

```

Output in the logs:

 ![1](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/b/2bc01d18d05e52f8af4e27bc24af7fdb323c44eb.png)
