Skip to content

[bug]: API allows archiving non-completed/non-canceled work items by PATCHing archived_at #9115

Description

@Gloria-GK-406

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

API Allows Archiving a Non-completed Work Item by Updating archived_at

Environment

  • Plane version: v1.3.0
  • Deployment: self-hosted
  • API path tested: /api/v1/workspaces/{workspace_slug}/projects/{project_id}/work-items/{work_item_id}/

Summary

We observed a behavior difference between the Plane Web UI and the API when archiving a work item.

In the Web UI, the archive action shows the following message for a work item that is not completed or canceled:

Only completed or canceled work items can be archived

However, using the API, we were able to archive a work item that was still in a non-completed state by updating the archived_at field directly.

We would like to confirm whether this is expected behavior or a bug.

Steps to Reproduce

  1. Create a work item.
  2. Keep the work item in a non-completed and non-canceled state, such as Todo or In Progress.
  3. Open the work item in the Web UI and check the archive action.
  4. The Web UI indicates that only completed or canceled work items can be archived.
  5. Send a PATCH request to the work item API:
curl -X PATCH \
  "$PLANE_HOST/api/v1/workspaces/$WORKSPACE_SLUG/projects/$PROJECT_ID/work-items/$WORK_ITEM_ID/" \
  -H "x-api-key: $PLANE_API_KEY" \
  -H "content-type: application/json" \
  -d '{"archived_at":"2026-05-22"}'

Observed Result

The API request returned 200 OK.

The work item was archived even though it was not in a completed or canceled state.

Expected Clarification

Could the Plane team confirm which behavior is expected?

  • Should the API allow archived_at to be updated directly regardless of the current work item state?
  • Or should the API follow the same rule shown in the Web UI, where only completed or canceled work items can be archived?

Additional Observation

We also tried the following path:

POST /api/v1/workspaces/{workspace_slug}/projects/{project_id}/work-items/{work_item_id}/archive/

It returned:

{"error": "Page not found."}

So the behavior described above was observed through PATCHing archived_at on the work item resource.

Steps to reproduce

Steps to Reproduce

  1. Create a work item.
  2. Keep the work item in a non-completed and non-canceled state, such as Todo or In Progress.
  3. Open the work item in the Web UI and check the archive action.
  4. The Web UI indicates that only completed or canceled work items can be archived.
  5. Send a PATCH request to the work item API:
curl -X PATCH \
  "$PLANE_HOST/api/v1/workspaces/$WORKSPACE_SLUG/projects/$PROJECT_ID/work-items/$WORK_ITEM_ID/" \
  -H "x-api-key: $PLANE_API_KEY" \
  -H "content-type: application/json" \
  -d '{"archived_at":"2026-05-22"}'

Observed Result

The API request returned 200 OK.

The work item was archived even though it was not in a completed or canceled state.

Environment

Production

Browser

Google Chrome

Variant

Local

Version

v1.30.0

Activity

  1. added
    🐛bug
    plane
    on May 22, 2026
  2. praneeth-7606 commented on Sep 25, 2026

    @praneeth-7606

    Reproduced -- the external API accepts archived_at as a writable field, so it bypasses the completed/cancelled state-group check enforced by the archive and bulk-archive-issues endpoints.

    I'm fixing this with server-side validation in the work item serializers (both the external API IssueSerializer and the app IssueCreateSerializer), using the same rule and error message as the existing archive endpoints, plus contract + unit tests. PR coming shortly.

    On the second point (POST .../work-items/{id}/archive/ returning 404): this PR only closes the validation hole. Adding dedicated archive/unarchive endpoints to the external API would be a new feature -- happy to open a separate proposal for that if the maintainers want it.

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

Metadata

Metadata

Assignees

Labels

plane🐛bug

Type

Fields

Edition

None yet

Version

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions