move_work_item_to_document
Move a work item into a Polarion document at a specific position, inserting it after or before a given part, or appending it to the end.
Instructions
Move a work item into a Polarion document at a specific position.
moveToDocument atomically sets module + outline_number and
inserts a part — the ONLY supported attach path (macro-injection leaves
module unset). Headings rejected (HTTP 400). Already-in-a-document
items are moved, not copied; detach via move_work_item_from_document.
AT MOST one of previous_part_id (AFTER) / next_part_id (BEFORE);
omit both to append. Discover part IDs via read_document_parts.
Side effect: auto-creates one outgoing link to the enclosing heading
(project-config role); collides with a same-role create_work_item_links
(phantom success). Removed on detach.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | Project containing the work item. | |
| work_item_id | Yes | Short ID of an EXISTING work item (e.g. 'MCPT-042'). | |
| target_space_id | Yes | Target space ID (use '_default' for the default space). | |
| target_document_name | Yes | Target document name within ``target_space_id``. | |
| previous_part_id | No | Insert AFTER this part ID; mutually exclusive with ``next_part_id``. Omit both to append at the end of the target document. | |
| next_part_id | No | Insert BEFORE this part ID; mutually exclusive with ``previous_part_id``. Omit both to append at the end of the target document. | |
| dry_run | No | When True, return payload preview without calling Polarion. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| moved | Yes | ||
| dry_run | Yes | ||
| payload_preview | Yes |