Groovy Script Management
OpenIAM uses Groovy scripts as customization hooks across the platform — provisioning policy maps, reconciliation transformers, authentication providers, batch task logic, and more. All scripts are managed through the Groovy Manager, accessible in the Webconsole under Administration → Groovy Manager.
Navigating the Groovy Manager
The Groovy Manager presents a file-browser tree on the left. Scripts are organized into folders (e.g. policymap, recon, auth). Click a folder to expand it and click a script name to open it in the editor.
The toolbar across the top provides:
| Button | Action |
|---|---|
| New Script | Create a new script in the selected folder |
| Save | Save the currently open script |
| Compile All | Compile every script and report errors |
| Import | Upload a .zip archive to bulk-import scripts |
| Export All | Download all scripts as a single .zip |
| Export Selected | Download the checked scripts as a .zip |
Creating and editing scripts
- Expand the folder in the tree where the script belongs.
- Click New Script, enter a name and version, then write your Groovy code in the editor.
- Click Save. OpenIAM compiles the script before saving — any compilation errors appear in the editor panel with a stack trace.
To edit an existing script, click its name in the tree. The editor opens with the current source. Edit and Save as above.
Scripts that import from
org.openiam.ui.*are compiled inside the Webconsole JVM. All other scripts are compiled by the Groovy Manager service.
Compiling all scripts
Click Compile All to validate every script in the system in one pass. The result panel lists each script that failed to compile, with the full stack trace. This is useful after an OpenIAM upgrade to catch API incompatibilities before they surface at runtime.
Importing scripts from a zip
Use Import to move scripts from another environment (e.g. development → staging → production) or to restore from a backup.
Steps
- Click Import in the toolbar.
- Select a
.zipfile from your filesystem and confirm. - A success banner appears: "Groovy scripts imported" (all scripts loaded) or "Groovy scripts partially imported" (some entries were skipped — see below).
Zip file format
The importer expects each Groovy file to be at:
<folder>/<name>_<version>.groovy
Examples of valid entries:
policymap/AddUserToAD_1.0.groovyrecon/LDAPTransformer_2.5.groovy
Examples of invalid entries (these are skipped):
AddUserToAD_1.0.groovy ← root level, no folderpolicymap/AddUserToAD.groovy ← missing version number
How conflicts are handled
If a script with the same path + name + version already exists, it is updated in-place — no duplicate is created. Scripts that are in the target system but absent from the zip are left untouched.
Skipped entries
Entries that fail the format check are logged as warnings in the OpenIAM audit log under the IMPORT_GROOVY_SCRIPTS action. Check the audit log if the "partially imported" banner appears to see exactly which files were skipped and why.
Exporting scripts
Exporting lets you back up all scripts or promote a subset to another environment.
Export all scripts
Click Export All. The browser downloads groovy-scripts.zip. The archive preserves the full folder hierarchy:
policymap/AddUserToAD_1.0.groovyrecon/LDAPTransformer_2.5.groovyauth/MFAProvider_1.0.groovy...
Export selected scripts
- Check the scripts you want in the file-browser tree (checkboxes appear on hover).
- Click Export Selected. The browser downloads
groovy-scripts-selected.zipcontaining only the checked scripts.
Importing the exported zip into another environment
The export format is fully compatible with the importer. A typical promotion workflow:
1. In the source environment → Export All (or Export Selected)2. In the target environment → Import → pick the downloaded zip3. Verify with Compile All
Audit trail
Every import and export operation is recorded in the OpenIAM audit log:
| Operation | Audit action |
|---|---|
| Import from zip | IMPORT_GROOVY_SCRIPTS |
| Export all / Export selected | EXPORT_GROOVY_SCRIPTS |
The audit record includes the number of scripts exported, and for imports lists any skipped entries as warnings.
REST API
All operations above are also available programmatically. See the Groovy Manager API reference for endpoint details.