create_document
Create a document in a Polarion space with unique name, title, type, and optional Markdown content. Validates inputs and configures workflow status, custom fields, and outline numbering.
Instructions
Create a document in a space.
document_name must be unique in the space — a duplicate name conflicts; check list_documents first. type/status and custom_fields keys are validated on write — resolve ids via list_document_enum_options first.
home_page_content is Markdown (greenfield only), converted to sanitized HTML. 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_home_page_content_html=True) and 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. | |
| 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':...}. | |
| document_name | Yes | Document name (e.g. 'MySpecV1'); unique within space_id, appears in the document URL. | |
| 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 |