update_document
Update a Polarion document's metadata or body. Supply only the attributes to change; omit those left unchanged.
Instructions
Update a Polarion document's metadata or body.
PATCHes only supplied attributes (omitted preserved); no follow-up GET. Fetch via get_document BEFORE updating. home_page_content_html is never sanitized or converted — source from get_document(include_homepage_content_html=True); blocks lacking an id= get one auto-stamped, a fully anchored body is sent byte-for-byte. Empty string rejected (orphans headings) — pass '' for near-empty.
Body rules:
Inline .. auto-create heading work items — THE way to add a heading. For body text or work items use create_work_items + move_work_item_to_document, NOT this tool.
A polarion_wiki macro name=module-workitem leaves the work item's module unset — attach via move_work_item_to_document.
Polarion-specific constructs (tables, captions, links, TOC/TOF widgets, page breaks) must be adapted from get_html_recipes templates, never hand-written.
workflow_action must pair with ≥1 attribute (else 400). Unknown status/type raise ValueError; custom_fields keys outside the document type's schema are rejected, values NOT validated — resolve via list_document_enum_options first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | New document type (e.g. 'req_specification'). | |
| title | No | ||
| status | No | New status; prefer workflow_action for real transitions. | |
| dry_run | No | Preview payload without writing; guards still query Polarion. | |
| space_id | Yes | Space ID ('_default' = default space). | |
| project_id | Yes | Polarion project ID. | |
| auto_suspect | No | Flag linked work items suspect on change. | |
| custom_fields | No | Partial; rich-text values as {'type':'text/html','value':...}. | |
| document_name | Yes | Document name within space_id. | |
| workflow_action | No | Workflow action ID. | |
| home_page_content_html | No | New body as raw HTML from get_document(include_homepage_content_html=True); '' rejected; anchorless blocks get id= auto-stamped. New tables, captions, or other Polarion constructs: call get_html_recipes first and adapt a template. | |
| uses_outline_numbering | No | Enable auto outline numbers (1, 1.1, ...). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dry_run | Yes | ||
| updated | Yes | ||
| payload_preview | Yes |