create_business_rule
Create ServiceNow business rules with custom server-side JavaScript. Configure trigger timing, table, condition, and activation status programmatically.
Instructions
Create a new business rule (requires SCRIPTING_ENABLED=true). ServiceNow supports ES2021 async/await in scripts.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Rule name | |
| when | Yes | "before" | "after" | "async" | "display" | |
| order | No | Execution order (default: 100) | |
| table | Yes | Table this rule applies to | |
| active | No | Whether to activate the rule (default: true) | |
| script | Yes | Server-side JavaScript. ServiceNow supports ES2021 (async/await, ?., ??). | |
| condition | No | Optional condition script |