sn_assign_roles
Assign or revoke ServiceNow roles to users or groups, and list assigned roles.
Instructions
Assign or revoke roles on a ServiceNow user or group.
target_type: user — Roles go on the individual user (sys_user_has_role) group — Roles go on the group; all members inherit them (sys_group_has_role)
action: assign — Grant the role(s) revoke — Remove the role(s) list — Show current roles
Examples: target_type="user" target="john.doe" action="assign" roles=["itil","catalog"] target_type="group" target="Network Ops" action="assign" roles=["itil","sn_incident_write"] target_type="user" target="jane.smith" action="list"
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target_type | Yes | ||
| target | Yes | Username/email/sys_id for user, or group name/sys_id for group | |
| action | Yes | ||
| roles | No | Role names (required for assign/revoke) |