update_work_item
Update an existing Polarion work item by modifying fields like title, status, hyperlinks, assignees, or custom fields. Supports workflow actions, type changes, and dry-run validation.
Instructions
Update an existing Polarion work item.
PATCHes supplied fields, then GETs so current reflects the change.
None / empty all mean leave unchanged — no clear path.
description_html is RAW Polarion HTML, verbatim, no sanitization (NEVER
pass untrusted input); round-trip with
get_work_item(include_description_html=True). Greenfield: use
create_work_items Markdown — paths never mix.
hyperlinks / assignee_ids REPLACE (full list, not delta); each
hyperlink role validated against hyperlink-role (before PATCH, on
dry_run too). custom_fields partial; a key absent from the type's
sampled schema is rejected (a type with no populated customs blocks it).
module NOT exposed — use move_work_item_to_document /
move_work_item_from_document. Prefer workflow_action over raw
status; workflow_action / change_type_to MUST pair with ≥1 body
field (empty PATCH 400s). Unknown status / severity / resolution
/ priority / change_type_to raise ValueError listing valid
options; with change_type_to set, status/severity/resolution scope to
the target type.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | Polarion project ID. | |
| work_item_id | Yes | Short ID of an EXISTING work item (e.g. 'MCPT-042'). | |
| title | No | ||
| description_html | No | New raw Polarion HTML body (round-trip shape from get_work_item). | |
| status | No | New workflow status; prefer ``workflow_action`` for real transitions. | |
| priority | No | New priority string (e.g. '50.0'). | |
| severity | No | ||
| due_date | No | New due date 'YYYY-MM-DD'. | |
| initial_estimate | No | New Polarion duration (e.g. '5 1/2d', '1w 2d'). | |
| resolution | No | New resolution outcome; prefer ``workflow_action`` so workflow rules apply. | |
| hyperlinks | No | REPLACES the hyperlink list — pass the full list, not a delta. | |
| assignee_ids | No | REPLACES the assignee list — pass the full list, not a delta. | |
| custom_fields | No | Partial custom-field update; rich-text values must be ``{'type':'text/html','value':...}``. | |
| workflow_action | No | Workflow action ID (e.g. 'close'); must be paired with at least one body field. | |
| change_type_to | No | Change work-item type; RESETS status; must be paired with at least one body field. | |
| include_current_description_html | No | When True, return the post-PATCH raw HTML body in ``current.description_html``. | |
| dry_run | No | When True, return the payload preview without writing; enum/custom-field guards still query Polarion, so the work item must be readable and the validation endpoint reachable. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| updated | Yes | ||
| dry_run | Yes | ||
| current | Yes | ||
| changes | Yes | ||
| payload_preview | Yes |