Create work item relation ​
POST/api/v1/workspaces/{workspace_slug}/projects/{project_id}/work-items/{work_item_id}/relations/
Create relationships between work items. Supports various relation types including blocking, blocked_by, duplicate, relates_to, start_before, start_after, finish_before, and finish_after.
Path Parameters ​
work_item_id:requiredstringThe unique identifier of the work item.
project_id:requiredstringThe unique identifier of the project.
workspace_slug:requiredstringThe workspace_slug represents the unique workspace identifier for a workspace in Plane. It can be found in the URL. For example, in the URL https://app.plane.so/my-team/projects/, the workspace slug is my-team.
Body Parameters ​
relation_type:requiredstringType of relationship between work items
blocking- Blockingblocked_by- Blocked Byduplicate- Duplicaterelates_to- Relates Tostart_before- Start Beforestart_after- Start Afterfinish_before- Finish Beforefinish_after- Finish After
issues:requiredarrayArray of work item IDs to create relations with
Scopes ​
projects.work_items:write
Create work item relation
bash
curl -X POST \
"https://api.plane.so/api/v1/workspaces/my-workspace/projects/project-uuid/work-items/work-item-uuid/relations/" \
-H "X-API-Key: $PLANE_API_KEY" \
# Or use -H "Authorization: Bearer $PLANE_OAUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"relation_type": "blocking",
"issues": [
"550e8400-e29b-41d4-a716-446655440000",
"550e8400-e29b-41d4-a716-446655440000"
]
}'python
import requests
response = requests.post(
"https://api.plane.so/api/v1/workspaces/my-workspace/projects/project-uuid/work-items/work-item-uuid/relations/",
headers={"X-API-Key": "your-api-key"},
json={
"relation_type": "blocking",
"issues": [
"550e8400-e29b-41d4-a716-446655440000",
"550e8400-e29b-41d4-a716-446655440000"
]
}
)
print(response.json())javascript
const response = await fetch(
"https://api.plane.so/api/v1/workspaces/my-workspace/projects/project-uuid/work-items/work-item-uuid/relations/",
{
method: "POST",
headers: {
"X-API-Key": "your-api-key",
"Content-Type": "application/json",
},
body: JSON.stringify({
relation_type: "blocking",
issues: ["550e8400-e29b-41d4-a716-446655440000", "550e8400-e29b-41d4-a716-446655440000"],
}),
}
);
const data = await response.json();Response201
json
[
[
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Example Name",
"sequence_id": 42,
"project_id": "550e8400-e29b-41d4-a716-446655440000",
"relation_type": "blocked_by",
"state_id": "550e8400-e29b-41d4-a716-446655440000",
"priority": "high",
"type_id": "550e8400-e29b-41d4-a716-446655440000",
"is_epic": false,
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z",
"created_by": "550e8400-e29b-41d4-a716-446655440000",
"updated_by": "550e8400-e29b-41d4-a716-446655440000"
}
]
]
