Skip to content

Fix: Change work-items endpoint to issues#18

Open
egeorcun wants to merge 2 commits into
makeplane:mainfrom
egeorcun:main
Open

Fix: Change work-items endpoint to issues#18
egeorcun wants to merge 2 commits into
makeplane:mainfrom
egeorcun:main

Conversation

@egeorcun
Copy link
Copy Markdown

@egeorcun egeorcun commented Jan 30, 2026

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/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

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Improvement (change that would cause existing functionality to not work as expected)
  • Code refactoring
  • Performance improvements
  • Documentation update

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:

  1. list() - Successfully lists all issues in a project
  2. create() - Successfully creates new issues
  3. retrieve() - Successfully retrieves issue by ID
  4. update() - Successfully updates existing issues
  5. delete() - Successfully deletes issues
  6. search() - Successfully searches issues

All 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

  • Chores
    • Core work-item API operations (create, retrieve, retrieve-by-identifier, update, delete, list, search) now use the "issues" namespace.
    • Advanced search, archive and unarchive operations continue to use the original "work-items" namespace.

Review Change Stack

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
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 30, 2026

📝 Walkthrough

Walkthrough

API 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.

Changes

API Endpoint Path Update

Layer / File(s) Summary
Replace work-items with issues in CRUD & search
plane/api/work_items/base.py
Replaced API path segment from work-items to issues across create, retrieve, retrieve_by_identifier, update, delete, list, and search methods. Request/response handling and parameters remain unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 I nibble code in morning light,
I hop on paths that changed their name,
From "work-items" to "issues" bright,
Endpoints trimmed, yet logic same,
A tiny hop, a tidy tweak,
The API hums — no need to speak.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: updating endpoint paths from work-items to issues across core CRUD/query operations in the WorkItems API resource.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 WorkItems and uses WorkItem* 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 WorkItemsIssues and 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",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 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 -5

Repository: makeplane/plane-python-sdk

Length of output: 52


🏁 Script executed:

find . -type f -name "base.py" | grep -i work 2>/dev/null

Repository: makeplane/plane-python-sdk

Length of output: 141


🏁 Script executed:

rg "workspace_slug.*projects.*issues" --type py -B 5 -A 5

Repository: 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.

egeorcun pushed a commit to egeorcun/plane-mcp-server that referenced this pull request Jan 30, 2026
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
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
plane/api/work_items/base.py (1)

46-47: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Revert these path literals to work-items and add trailing / to match the SDK contract.

These edits move core methods to issues paths 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

📥 Commits

Reviewing files that changed from the base of the PR and between 71818c3 and ad2b82a.

📒 Files selected for processing (1)
  • plane/api/work_items/base.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant