Skip to content

Commit 71818c3

Browse files
author
Ege Orcun
committed
Fix: Change work-items endpoint to issues
The Plane API uses /issues/ endpoint for work items, but the SDK was using /work-items/ which causes HTTP 404 errors on all work item operations. Changed endpoints in plane/api/work_items/base.py: - create(): /work-items -> /issues - retrieve(): /work-items/{id} -> /issues/{id} - retrieve_by_identifier(): /work-items/{identifier} -> /issues/{identifier} - update(): /work-items/{id} -> /issues/{id} - delete(): /work-items/{id} -> /issues/{id} - list(): /work-items -> /issues - search(): /work-items/search -> /issues/search
1 parent ec524f9 commit 71818c3

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

plane/api/work_items/base.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def create(self, workspace_slug: str, project_id: str, data: CreateWorkItem) ->
3939
data: Work item data
4040
"""
4141
response = self._post(
42-
f"{workspace_slug}/projects/{project_id}/work-items",
42+
f"{workspace_slug}/projects/{project_id}/issues",
4343
data.model_dump(exclude_none=True),
4444
)
4545
return WorkItem.model_validate(response)
@@ -80,7 +80,7 @@ def retrieve(
8080
"""
8181
query_params = params.model_dump(exclude_none=True) if params else None
8282
response = self._get(
83-
f"{workspace_slug}/projects/{project_id}/work-items/{work_item_id}",
83+
f"{workspace_slug}/projects/{project_id}/issues/{work_item_id}",
8484
params=query_params,
8585
)
8686
return WorkItemDetail.model_validate(response)
@@ -102,7 +102,7 @@ def retrieve_by_identifier(
102102
"""
103103
query_params = params.model_dump(exclude_none=True) if params else None
104104
response = self._get(
105-
f"{workspace_slug}/work-items/{project_identifier}-{issue_identifier}",
105+
f"{workspace_slug}/issues/{project_identifier}-{issue_identifier}",
106106
params=query_params,
107107
)
108108
return WorkItemDetail.model_validate(response)
@@ -123,7 +123,7 @@ def update(
123123
data: Updated work item data
124124
"""
125125
response = self._patch(
126-
f"{workspace_slug}/projects/{project_id}/work-items/{work_item_id}",
126+
f"{workspace_slug}/projects/{project_id}/issues/{work_item_id}",
127127
data.model_dump(exclude_none=True),
128128
)
129129
return WorkItem.model_validate(response)
@@ -136,7 +136,7 @@ def delete(self, workspace_slug: str, project_id: str, work_item_id: str) -> Non
136136
project_id: UUID of the project
137137
work_item_id: UUID of the work item
138138
"""
139-
return self._delete(f"{workspace_slug}/projects/{project_id}/work-items/{work_item_id}")
139+
return self._delete(f"{workspace_slug}/projects/{project_id}/issues/{work_item_id}")
140140

141141
def list(
142142
self,
@@ -167,7 +167,7 @@ def list(
167167
"""
168168
query_params = params.model_dump(exclude_none=True) if params else None
169169
response = self._get(
170-
f"{workspace_slug}/projects/{project_id}/work-items", params=query_params
170+
f"{workspace_slug}/projects/{project_id}/issues", params=query_params
171171
)
172172
return PaginatedWorkItemResponse.model_validate(response)
173173

@@ -187,5 +187,5 @@ def search(
187187
search_params = {"q": query}
188188
if params:
189189
search_params.update(params.model_dump(exclude_none=True))
190-
response = self._get(f"{workspace_slug}/work-items/search", params=search_params)
190+
response = self._get(f"{workspace_slug}/issues/search", params=search_params)
191191
return WorkItemSearch.model_validate(response)

0 commit comments

Comments
 (0)