copy_document
Duplicate a document's complete content and work items into a new document name within the same or different project/space.
Instructions
Copy a document, duplicating its structure, body, and contained work items.
Rebuilding via create_document/update_document loses the contained items. target_document_name must be free at the destination — check list_documents first. Destination defaults to the source project/space.
link_original_items_with_role is validated against the TARGET project's workitem-link-role enum; remove_outgoing_links strips links carried over from the source.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dry_run | No | Preview payload without writing; guards still query Polarion. | |
| revision | No | Copy the source as of this revision (HEAD if omitted). | |
| space_id | Yes | Source space ID ('_default' = default space). | |
| project_id | Yes | Source project ID. | |
| document_name | Yes | Source document name. | |
| target_space_id | No | Destination space (source space if omitted). | |
| target_project_id | No | Destination project (source project if omitted). | |
| target_document_name | Yes | New document name; must not already exist at the destination. | |
| remove_outgoing_links | No | Strip outgoing links from copied items (kept if omitted). | |
| link_original_items_with_role | No | Link each copied item back to its original with this workitem-link-role id (e.g. 'duplicates'). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| copied | Yes | ||
| dry_run | Yes | ||
| document_name | Yes | ||
| payload_preview | Yes | ||
| target_space_id | Yes | ||
| target_project_id | Yes |