Task-Publication Link Migration
This page covers migration notes for links between tasks and publications.
Use it together with Task-Publication Linking, the Elements, Element Tasks, and Element Publications migration pages.
Scope
Covered link surfaces:
| Write flow | v2 link field |
|---|---|
Root element POST, PUT, PATCH | publications[].assignedTaskRefs |
Standalone publication POST, PATCH | assignedTaskIds |
Standalone task POST, PATCH | No publication-linking field |
Field Mapping
| v1 usage pattern | v2 direction |
|---|---|
Root publications[].assignments boolean array | Build publications[].assignedTaskRefs explicitly. |
Standalone publication assignedTasks | Use assignedTaskIds. |
Response publications[].assignments | Read publications[].assignedTaskIds from v2 responses. |
Linking a new same-request task by position in tasks[] | Give the new task a tasks[].localId and reference it from assignedTaskRefs[].localId. |
| Linking an existing task | Use assignedTaskRefs[].taskId in root writes or assignedTaskIds[] in standalone publication writes. |
Root Element Writes
v1 root element payloads linked tasks and publications with a positional boolean array. Each value
in publications[].assignments corresponded to the task at the same index in tasks[].
v2 removes that positional contract. Root element writes use explicit references:
v2 root element write
Migration pattern for root payloads:
- Assign a stable request-local
localIdto each new task that needs to be linked. - Convert every
truevalue in the old positional assignment array to an explicit assignment ref. - Use
localIdwhen the target task is created in the same request. - Use
taskIdwhen the target task already exists. - Send
assignedTaskRefs: []when a publication intentionally has no linked tasks.
For root POST and root PUT, each publication must declare assignedTaskRefs. For root PATCH,
omitting assignedTaskRefs leaves the current links unchanged, while assignedTaskRefs: [] clears
them.
Standalone Publication Writes
Standalone publication writes use persisted task IDs only:
v2 standalone publication write
Rules:
assignedTaskIdsaccepts tasks that already exist under the same element.- unknown task IDs or tasks from another element return
404 Not Found. - on create, omitted,
null, or[]creates the publication without task links. - on patch, omitted leaves links unchanged,
[]clears links, andnullis invalid. localIdis not accepted by standalone publication endpoints.
Standalone Task Writes
Standalone task create and patch do not link the task to publications.
To link a new standalone task to a publication:
-
create the task with
POST /api/v2/elements/{id}/tasks. -
read the persisted task ID from the returned parent element aggregate.
-
patch the publication with
assignedTaskIds.
Response Changes
v2 publication responses expose linked task IDs as assignedTaskIds.
Do not parse or expect assignments in v2 responses. The response IDs are persisted task IDs and
are the values to use in later standalone publication writes.
Migration Checklist
- Replace positional
assignmentsarrays with explicitassignedTaskRefs. - Add request-local
localIdvalues for new tasks that must be linked in the same root request. - Replace standalone
assignedTaskswithassignedTaskIds. - Stop expecting task creation to assign the task to publications automatically.
- Stop parsing
publications[].assignmentsfrom responses; parseassignedTaskIds. - Verify
PATCHbehavior: omitted links stay unchanged,[]clears links, andnullis invalid.