create_document
Create a new document in a Polarion space. Requires project, space, module name, title, and type. Optionally add status, custom fields, and Markdown homepage content.
Instructions
Create a new Polarion document in a space.
module_name must be unique in the space (duplicate → HTTP 409) — check list_documents first. type/status validated — unknown ids raise ValueError with options; custom_fields keys validated against the document type schema.
home_page_content is Markdown → sanitized HTML, blocks auto-stamped with unique ids. Markdown tables get native Polarion styling; a paragraph starting 'Table:' directly after a table becomes a numbered caption widget. Post-create edits round-trip raw HTML via get_document(include_homepage_content_html=True) ↔ update_document; add work items via move_work_item_to_document.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | Document type (e.g. 'req_specification', 'generic'). | |
| title | Yes | Human-readable document title. | |
| status | No | Initial workflow status (project default if omitted). | |
| 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. | |
| module_name | Yes | Document identifier (e.g. 'MySpecV1'); unique within space_id, appears in the document URL. | |
| auto_suspect | No | Flag linked work items suspect on change. | |
| custom_fields | No | Keyed by Polarion field ID (copy keys from a sibling document); rich-text values as {'type':'text/html','value':...}. | |
| home_page_content | No | Markdown body; converted to sanitized HTML. | |
| uses_outline_numbering | No | Enable auto outline numbers (1, 1.1, ...). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| created | Yes | ||
| dry_run | Yes | ||
| document_name | Yes | ||
| payload_preview | Yes |