create_usem_rule
Create a USEM/VR automation rule. Provide the rule_type and a fields object matching that table allowlist (e.g. name/rule_name, active, order, condition, assignment_group, ttr_max).
Instructions
Create a USEM/VR automation rule. Provide the rule_type and a fields object matching that table allowlist (e.g. name/rule_name, active, order, condition, assignment_group, ttr_max). Every field is read back after the write; a value ServiceNow did not store fails with FIELDS_NOT_SAVED. remediation_task with assignment_type 5 (Group by field) also needs assignment_group_fields — a field path on the finding that matches one of field_1..6 (e.g. "assignment_group"). The Table API cannot write that field, so it is set by a run-once server script and additionally requires SCRIPTING_ENABLED=true. Create rules inactive and enable them with set_usem_rule_active after checking them. [Write — requires WRITE_ENABLED=true; admin-level config change]
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fields | Yes | Column/value map for the rule record. Schema allows the union of all USEM rule fields; runtime also restricts fields to the selected rule_type. | |
| rule_type | Yes | Which rule family to operate on: assignment (sn_sec_wf_assign_rule), remediation_task, remediation_target (TTR/SLA targets), risk_calculator + calculator_rule + risk_field + risk_score_weight + calculator_config (risk scoring), classification + classification_rule, exception_rule + exception_config, rollup (score rollup), approval, auto_close, exclusion | |
| wait_seconds | No | Only used for script-written fields (assignment_group_fields): how long to wait for the run-once job (0-120, default 60). |