This page explains how to write the Script Body for an Alert Script. The script runs server-side and synchronously when the trigger event fires (Create / Update / Delete).
The script acts as a boolean filter:
Return true → the event is significant and an alert should be generated
Return false → suppress the alert for this event
1) Script Body rules (must-follow)
Groovy only
The Script Body is the inside of a method
✅ Write statements directly
❌ Do not add a class or method signature
Always return a boolean on every path
Prefer early return false for readability and safety
2) Runtime variables (available without declaration)
These are injected into the script context automatically:
Core context
dlpObject (Object) Current state of the object that triggered the event.
oldDlpObject (Object) Previous state of the object only for UPDATE events. Often null on INSERT, and may not match expected type.
wsUser (User) The user/system account that performed the action. Useful for role-based suppression.
Message output
mapResultsForMessage (Map<String, String>) Placeholder map for template-based message text. Typical keys are "?1", "?2" etc.
mapMessageFromServer (Map<String, String>) Full message override. Use key "MSG" to provide the message text.