How do I update custom fields in a LUA script

Document ID : KB000095394
Last Modified Date : 25/05/2018
Show Technical Document Details
Introduction:
We need to integrate our alarms to a third party tool.
We need to update the alarm with information based on robot and message so that
when the alarm gets to our third party application they can use the information
to properly route the alarms.
 
Question:
How can we update alarms user fields using NAS LUA script to be able to add
custom information in-order to be used by third party tools.
 
Environment:
UIM 8.X+
NAS 8.X+
 
Answer:
Below is a sample script to update custom1 field using nas.

msg = "Custom Value for Ticketing system"
event.custom1= msg
print("Script Custom 1" .. event.custom1)
return event