Update work package relation
update_work_package_relationUpdate an existing work package relation by changing its type, lag, or description. Adjust scheduling gaps or correct link types on the fly.
Instructions
Change an existing relation's type, lag or description.
Use it to widen the gap between a predecessor and its successor, to correct a link that was created with the wrong type, or to explain why two work packages are connected. Returns the updated relation.
Pitfalls. At least one of type, lag or description must be given.
Relations carry no lock version, so this is a plain overwrite with no
conflict detection — a concurrent edit is silently replaced; re-read the
relation if that matters. The two work packages cannot be changed here:
delete the relation and create a new one instead. Raising the lag on a
follows relation reschedules the successor, so dates can move.
Cross-references: create_work_package_relation makes one;
delete_work_package_relation removes it;
get_work_package(include=['relations']) lists the ids.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lag | No | New lag in working days; valid only while the relation is 'follows' or 'precedes'. Omit to leave it untouched, pass 0 to remove an existing lag. When lag is given without type, the current type is read first and a lag on a non-scheduling relation is refused before any write. | |
| type | No | New relation type. Omit to keep the current one. Switching to or from 'follows'/'precedes' changes whether the relation schedules dates. | |
| description | No | New note for the relation. Omit to leave it untouched; pass an empty string to clear it. | |
| relation_id | Yes | Id of the relation to change. It comes from create_work_package_relation or get_work_package(include=['relations']) — it is not a work package id. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Relation id. Pass it to update_work_package_relation or delete_work_package_relation — it is not a work package id. | |
| lag | No | Working days kept between the predecessor and the successor. Only follows/precedes relations carry one; null everywhere else. | |
| type | No | Relation type as OpenProject stored it, read from the 'from' work package (e.g. 'follows' means 'from' is scheduled after 'to'). | |
| description | No | Free-text note stored on the relation; null when unset. | |
| reverse_type | No | The same relation read from the 'to' work package: 'follows' <-> 'precedes', 'blocks' <-> 'blocked', 'relates' <-> 'relates'. | |
| to_work_package | No | Work package the relation points to. | |
| from_work_package | No | Work package the relation starts at. |