create_work_item
Create a new work item in a Polarion project. Specify title, type, description, status, priority, assignees, due date, hyperlinks, and custom fields.
Instructions
Create a new Polarion work item in a project.
The work item is created free-floating — to place it inside a
document at a specific outline position, follow up with
move_work_item_to_document. Direct creation into a document via
the module relationship is intentionally NOT exposed: per the
Polarion API, such work items land in the document's recycle bin
until a separate Document Part is created, leaving them invisible
in the document body. Always pair create + move for a single,
visible result.
Format asymmetry: description here is Markdown (converted to
sanitized HTML on write) because greenfield authoring is natural for
LLMs. After creation the round-trip pair is
get_work_item(include_description_html=True) ↔
update_work_item(description_html=...) which speaks raw HTML
verbatim. The two formats never mix.
Polarion does NOT validate enum membership server-side. Unknown
type / status / severity ids are stored verbatim as
ghost values that look real on later reads but never match Lucene
queries. priority is the only partial exception: a non-numeric
string coerces to the project default, but a numeric string outside
the enum set (e.g. "999.0") also persists verbatim. Resolve valid
ids first via list_work_item_enum_options(project_id, field_id,
work_item_type). custom_fields is the same story: unknown
field IDs — including brand-new IDs that no work item of this type
has ever used — silently persist as ghost attributes. Pass keys
taken from a prior get_work_item.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | Polarion project ID. | |
| title | Yes | Work item title (required, non-empty). | |
| type | Yes | Work item type (e.g. 'requirement', 'task', 'testCase'). | |
| description | No | Optional Markdown body; converted to sanitized HTML on write. | |
| status | No | Optional initial workflow status (project default applies if omitted). | |
| priority | No | Optional priority string (e.g. '50.0'). | |
| severity | No | Optional severity classification (e.g. 'major', 'critical'). | |
| assignee_ids | No | Optional short user IDs to assign (e.g. ['alice', 'bob']). | |
| due_date | No | Optional due date 'YYYY-MM-DD'. | |
| initial_estimate | No | Optional Polarion duration (e.g. '5 1/2d', '1w 2d', '4h'). | |
| hyperlinks | No | Optional external hyperlinks; each must have ``role`` and ``uri``. | |
| custom_fields | No | Optional custom fields keyed by Polarion field ID; rich-text values must be ``{'type':'text/html','value':...}``. | |
| dry_run | No | When True, return payload preview without calling Polarion. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| created | Yes | True on a real create; False on dry-run. | |
| dry_run | Yes | Whether this was a dry-run. | |
| work_item_id | Yes | ID of the new work item (e.g. 'MCPT-042'); None on dry-run. | |
| payload_preview | Yes | JSON:API payload sent or previewed; None after real ops. |