Fix: Change work-items endpoint to issues#18
Conversation
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
📝 WalkthroughWalkthroughAPI endpoint paths in the WorkItems class are updated from "work-items" to "issues" for create, retrieve, retrieve_by_identifier, update, delete, list, and search methods. ChangesAPI Endpoint Path Update
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@plane/api/work_items/base.py`:
- Line 42: All endpoints in base.py that build the deprecated issues path need
to be updated: replace any occurrences of the string
f"{workspace_slug}/projects/{project_id}/issues" (used by methods create(),
retrieve(), update(), delete(), and list()) with
f"{workspace_slug}/projects/{project_id}/work-items"; search for any other uses
of "issues" in URL builders within class methods in this file and update them to
"work-items" so all request paths (create, retrieve, update, delete, list)
conform to the v1 API.
🧹 Nitpick comments (1)
plane/api/work_items/base.py (1)
21-31: Consider aligning SDK naming with API terminology in a future refactor.The class is named
WorkItemsand usesWorkItem*models, but the actual API endpoints use/issues/. While acceptable for this bug fix, this naming mismatch could confuse SDK users who might expect the API paths to match the class name.A future refactor could rename
WorkItems→Issuesand the related models to align with the API terminology, though this would be a breaking change requiring a major version bump.
| """ | ||
| response = self._post( | ||
| f"{workspace_slug}/projects/{project_id}/work-items", | ||
| f"{workspace_slug}/projects/{project_id}/issues", |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
Plane API v1.0.0 official documentation issues endpoint
💡 Result:
Plane’s official API v1 docs are on the Plane Developers site (API Reference). The docs note that all /api/v1/.../issues/ endpoints are deprecated in favor of /api/v1/.../work-items/ (support ends March 31, 2026). [2]
Base URL (Plane Cloud): https://api.plane.so/ [1]
“Issues” (Work Items) endpoints (v1)
These are documented under Work Item (the pages’ URLs still contain /api-reference/issue/..., but the endpoint paths use work-items). [3]
- Create:
POST /api/v1/workspaces/{workspace_slug}/projects/{project_id}/work-items/[3] - List:
GET /api/v1/workspaces/{workspace_slug}/projects/{project_id}/work-items/[4] - Get by ID:
GET /api/v1/workspaces/{workspace_slug}/projects/{project_id}/work-items/{work_item_id}/[5] - Update:
PATCH /api/v1/workspaces/{workspace_slug}/projects/{project_id}/work-items/{work_item_id}/[6] - Delete:
DELETE /api/v1/workspaces/{workspace_slug}/projects/{project_id}/work-items/{work_item_id}/[7]
🏁 Script executed:
cd /tmp && find . -name "base.py" -path "*/work_items/*" 2>/dev/null | head -5Repository: makeplane/plane-python-sdk
Length of output: 52
🏁 Script executed:
find . -type f -name "base.py" | grep -i work 2>/dev/nullRepository: makeplane/plane-python-sdk
Length of output: 141
🏁 Script executed:
rg "workspace_slug.*projects.*issues" --type py -B 5 -A 5Repository: makeplane/plane-python-sdk
Length of output: 11248
Replace deprecated /issues endpoints with /work-items paths.
The Plane API v1 documentation specifies that /api/v1/.../issues/ endpoints are deprecated in favor of /api/v1/.../work-items/ (deprecation support ends March 31, 2026). This file uses the deprecated /issues path across all methods—create(), retrieve(), update(), delete(), and list(). Update all endpoint paths from {workspace_slug}/projects/{project_id}/issues to {workspace_slug}/projects/{project_id}/work-items to align with current API standards.
🤖 Prompt for AI Agents
In `@plane/api/work_items/base.py` at line 42, All endpoints in base.py that build
the deprecated issues path need to be updated: replace any occurrences of the
string f"{workspace_slug}/projects/{project_id}/issues" (used by methods
create(), retrieve(), update(), delete(), and list()) with
f"{workspace_slug}/projects/{project_id}/work-items"; search for any other uses
of "issues" in URL builders within class methods in this file and update them to
"work-items" so all request paths (create, retrieve, update, delete, list)
conform to the v1 API.
Temporarily using forked plane-sdk from: https://github.com/egeorcun/plane-python-sdk This fixes the /work-items -> /issues endpoint issue. Will revert to official SDK once PR makeplane#18 is merged: makeplane/plane-python-sdk#18
There was a problem hiding this comment.
♻️ Duplicate comments (1)
plane/api/work_items/base.py (1)
46-47:⚠️ Potential issue | 🟠 Major | ⚡ Quick winRevert these path literals to
work-itemsand add trailing/to match the SDK contract.These edits move core methods to
issuespaths and omit trailing slashes, which violates the resource path convention used for this module and creates mixed endpoint families within the same class.Suggested patch
- f"{workspace_slug}/projects/{project_id}/issues", + f"{workspace_slug}/projects/{project_id}/work-items/", ... - f"{workspace_slug}/projects/{project_id}/issues/{work_item_id}", + f"{workspace_slug}/projects/{project_id}/work-items/{work_item_id}/", ... - f"{workspace_slug}/issues/{project_identifier}-{issue_identifier}", + f"{workspace_slug}/work-items/{project_identifier}-{issue_identifier}/", ... - f"{workspace_slug}/projects/{project_id}/issues/{work_item_id}", + f"{workspace_slug}/projects/{project_id}/work-items/{work_item_id}/", ... - return self._delete(f"{workspace_slug}/projects/{project_id}/issues/{work_item_id}") + return self._delete(f"{workspace_slug}/projects/{project_id}/work-items/{work_item_id}/") ... - f"{workspace_slug}/projects/{project_id}/issues", params=query_params + f"{workspace_slug}/projects/{project_id}/work-items/", params=query_params ... - response = self._get(f"{workspace_slug}/issues/search", params=search_params) + response = self._get(f"{workspace_slug}/work-items/search/", params=search_params)As per coding guidelines, "
plane/api/**/*.py: Never use 'Issue' in endpoint or parameter names — always use 'Work Item' instead" and "All API endpoints should end with a trailing/and follow URL convention:{base_path}/api/v1{resource_base_path}/{endpoint}/".Also applies to: 87-89, 109-110, 130-131, 143-143, 174-175, 194-194
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@plane/api/work_items/base.py` around lines 46 - 47, Replace the hardcoded "issues" endpoint fragments with "work-items" and ensure every resource path string ends with a trailing slash; specifically update occurrences that build paths like f"{workspace_slug}/projects/{project_id}/issues" to f"{workspace_slug}/projects/{project_id}/work-items/" (and likewise for any other f-strings or literals that use "issues") so the SDK contract is honored, keeping the same payload usage (data.model_dump(exclude_none=True)) and applying the same fix to the other affected occurrences in this file (the other path literals referenced in the review).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Duplicate comments:
In `@plane/api/work_items/base.py`:
- Around line 46-47: Replace the hardcoded "issues" endpoint fragments with
"work-items" and ensure every resource path string ends with a trailing slash;
specifically update occurrences that build paths like
f"{workspace_slug}/projects/{project_id}/issues" to
f"{workspace_slug}/projects/{project_id}/work-items/" (and likewise for any
other f-strings or literals that use "issues") so the SDK contract is honored,
keeping the same payload usage (data.model_dump(exclude_none=True)) and applying
the same fix to the other affected occurrences in this file (the other path
literals referenced in the review).
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 77cd5c2f-3120-4552-b087-f241bb4c5204
📒 Files selected for processing (1)
plane/api/work_items/base.py
Description
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.This PR fixes the endpoint paths in
plane/api/work_items/base.py:Changed endpoints:
create():/work-items→/issuesretrieve():/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→/issuessearch():/work-items/search→/issues/searchType of Change
Screenshots and Media (if applicable)
Before (404 Error):
POST /api/v1/workspaces/plane/projects/{id}/work-items/ 404
After (200 Success):
POST /api/workspaces/plane/projects/{id}/issues/ 200
Test Scenarios
Tested on self-hosted Plane instance (v1.0.0) with plane-mcp-server:
list()- Successfully lists all issues in a projectcreate()- Successfully creates new issuesretrieve()- Successfully retrieves issue by IDupdate()- Successfully updates existing issuesdelete()- Successfully deletes issuessearch()- Successfully searches issuesAll operations return expected responses instead of 404 errors.
References
Related to plane-mcp-server integration - the MCP server uses this SDK and was failing on all work item operations due to incorrect endpoint paths.
Summary by CodeRabbit