Create work package
create_work_packageCreate OpenProject work packages such as tasks, bugs, subtasks, and milestones with form validation that reports invalid fields and their allowed values before saving.
Instructions
Create a work package, validated through OpenProject's own form endpoint first.
Use it for new tasks, bugs, subtasks (parent_id) and milestones (date). The form
pre-flight surfaces an invalid status, a missing required custom field or a disallowed
type as structured violations with the allowed values, before anything is written.
Returns the created work package in full detail, including its new id, lock_version
and resolved custom fields.
Pitfalls: type, status and priority take names or ids; versions, assignees and
parents need numeric ids. Custom fields must exist on the schema — check
get_work_package_schema when unsure.
To change it afterwards use update_work_package; to attach a file to an existing work
package use upload_attachment.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | No | ISO date for a **milestone** (used instead of start_date/due_date). Passing both is rejected locally. | |
| type | Yes | Type name or id ('Task', 'Bug', 'Milestone', or 7). Unknown or ambiguous names fail listing the valid values. | |
| notify | No | Email notifications for this creation. | |
| sprint | No | Numeric sprint id; from list_sprints. Omit to leave unset. | |
| status | No | Status name or numeric id. Omit for the type's default; don't guess. | |
| project | Yes | Numeric project id or identifier (URL slug); from list_projects. | |
| subject | Yes | The title; must not be blank. | |
| version | No | Numeric version id; from get_project_metadata. | |
| assignee | No | Numeric user id ('me' isn't accepted in writes; get_instance_info gives the current user's id). | |
| due_date | No | ISO date (YYYY-MM-DD); not valid on milestones. | |
| priority | No | Priority name or id ('High', 'Normal', or 8). Omit for default. | |
| parent_id | No | Work package id to create this as a child of. | |
| start_date | No | ISO date (YYYY-MM-DD); not valid on milestones. | |
| description | No | Body text in markdown. | |
| responsible | No | Numeric id of the accountable person. | |
| story_points | No | Story points as a non-negative integer. | |
| custom_fields | No | Custom field writes keyed by wire key or display name: {'customField12': 'High'} or {'Severity': 'High'}. List/user/version fields take ids or names. Unknown keys fail listing the valid ones. get_work_package_schema shows what this project/type accepts. | |
| estimated_hours | No | Estimate in hours, decimal (e.g. 7.5). | |
| remaining_hours | No | Remaining work in hours, decimal. | |
| target_versions | No | Target version ids. [] clears; omit to keep defaults. Multiple values need instance support. Mutually exclusive with version. | |
| attachment_paths | No | Local file paths to attach (stdio transport only — the server must share your filesystem). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Work package id. | |
| date | No | Milestone date (ISO YYYY-MM-DD); null for non-milestones. | |
| type | No | Work package type. | |
| notes | No | Degradation notes for this result. | |
| author | No | Creating user. | |
| parent | No | Parent work package. | |
| sprint | No | The sprint the work package is planned in; null when unassigned. | |
| status | No | Status. | |
| project | No | Owning project. | |
| subject | No | Subject line. | |
| version | No | Legacy alias: the sole target version, or null for zero/multiple. | |
| assignee | No | Assigned user or group. | |
| category | No | Category. | |
| due_date | No | ISO date (YYYY-MM-DD). | |
| priority | No | Priority. | |
| available | No | Feature availability for this WP: dev links, meetings, files. | |
| created_at | No | ISO 8601 UTC timestamp. | |
| display_id | No | Human-facing id as the instance renders it. Matches the numeric id unless the instance uses semantic identifiers (17.x, e.g. 'PROJ-42'); null when the instance predates it. | |
| start_date | No | ISO date (YYYY-MM-DD). | |
| updated_at | No | ISO 8601 UTC timestamp. | |
| description | No | Description as markdown (raw); html is dropped. | |
| responsible | No | Accountable user. | |
| spent_hours | No | Logged time in hours. | |
| lock_version | No | Optimistic-locking version; pass to update_work_package. | |
| story_points | No | Story points. | |
| custom_fields | No | Always a list; empty when none are set. | |
| project_phase | No | Project phase this work package sits in (16.1+, only when phases are active in the project and visible to this user); details via get_project_phase. | |
| estimated_hours | No | Estimate in hours. | |
| percentage_done | No | Progress, 0-100. | |
| remaining_hours | No | Remaining work in hours. | |
| target_versions | No | All target versions; legacy instances yield zero or one. |