create_work_package_relation
Create a relation between two OpenProject work packages by setting their IDs and relation type, with a preview step before applying.
Instructions
Create a relation between work packages.
relation_type: relates, duplicates, duplicated, blocks, blocked, precedes, follows, includes, partof, requires, required. work_package_id becomes from_id and related_to_work_package_id becomes to_id, but OpenProject stores only one canonical type per pair and silently rewrites the other: creating with relation_type='precedes' (or 'blocked', 'duplicated', 'partof', 'required') is stored as the paired canonical type ('follows', 'blocks', 'duplicates', 'includes', 'requires' respectively) with from_id/to_id SWAPPED relative to work_package_id/related_to_work_package_id. The canonical types themselves ('follows', 'blocks', 'duplicates', 'includes', 'requires', and non-directional 'relates') are stored exactly as given, with from_id/to_id unswapped. This happens once at creation and does not depend on which work package's relations you later query; always read the actual type/from_id/to_id from the response rather than assuming they match what you requested.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lag | No | ||
| confirm | No | false: preview only, nothing changes. true: applies it; get the user's approval of the preview first. | |
| description | No | ||
| relation_type | Yes | ||
| work_package_id | Yes | Work package id (e.g. 952) or display id (e.g. "PROJ-51"), not the bare number 51. | |
| related_to_work_package_id | Yes | Work package id (e.g. 952) or display id (e.g. "PROJ-51"), not the bare number 51. |