clone_widget
Clone an existing Service Portal widget with a new name, applying optional modifications to template, CSS, client script, server script, and more.
Instructions
Clone an existing Service Portal widget with a new name and optional modifications.
Fetches all 4 widget sections (template, CSS, client script, server script) plus option schema from the source widget, then produces a ready-to-deploy payload for the cloned version with your modifications applied.
Modifications you can apply at clone time: template, css, client_script, server_script, option_schema, demo_data, description
Returns: POST-ready payload for sp_widget table + provenance comment in each section.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source_id | Yes | Source widget ID (e.g. "sc-cat-item") or sys_id | |
| new_name | Yes | Display name for the cloned widget | |
| new_id | No | Widget ID for cloned widget (defaults to kebab-case of new_name) | |
| modifications | No |