Skip to content

[bug]: Creating or patching a work issue from API does not use requested "completed_at" field #9011

Open

Description

@jordent

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

Experiencing:
When creating or updating a work item via the API, the completed_at field is documented as optional. However, if you provide completed_at when creating an item that is already in a "Done" state, the value is ignored and the current date/time is used instead. It seems that completed_at can be set for items that are not yet completed, and the value will persist—but those items will not appear as completed in the UI. If the item's state is later changed to "Done," the completed_at date is overwritten. So it seems there is no real way to give a work item a specific completed date.

Expected Behavior:
The API should respect the completed_at value provided, regardless of the work item's state. Technically, completed_at could only be allowed to be specified only if the state group is Completed but that isn't as important.

Steps to reproduce

  1. Send a request to create a new issue with a completed state of done and set dates. project_id is valid, and state is the valid id for the 'Done' state for that project.

    Route:
    POST /api/v1/workspaces/pfp/projects/{project_id}/work-items/

    Body:

    {
        "name": "Test Work Item",
        "description_html": "<p>Test description</p>",
       "start_date": "2026-01-02",
        "completed_at": "2026-01-03T00:00:00+00:00",
        "target_date": "2026-01-04",
        "state": "3dd0f6a1-ead7-44ee-af95-1197eb501225"
    }

    Response: 201 Created

    {
        "id": "7145a954-1280-4dd0-a7ac-09194b14c476",
        "created_at": "2026-05-04T11:57:37.184366-04:00",
        "updated_at": "2026-05-04T11:57:37.184403-04:00",
        "deleted_at": null,
        "name": "Test Work Item",
        "description_html": "<p>Test description</p>",
        "start_date": "2026-01-02",
        "target_date": "2026-01-04",
        "completed_at": "2026-05-04T11:57:37.153978-04:00",
        "state": "3dd0f6a1-ead7-44ee-af95-1197eb501225"
    }

    Note that completed_at is just the current date.

  2. Try to patch same work item with correct date.

    Route:
    PATCH /api/v1/workspaces/pfp/projects/{project_id}/work-items/7145a954-1280-4dd0-a7ac-09194b14c476/

    Body:

    {
        "completed_at": "2026-01-03T00:00:00+00:00"
    }

    Response: 200 OK

    {
        "id": "7145a954-1280-4dd0-a7ac-09194b14c476",
        "created_at": "2026-05-04T11:57:37.228653-04:00",
        "updated_at": "2026-05-04T12:14:24.915905-04:00",
        "deleted_at": null,
        "name": "Test Work Item",
        "description_html": "<p>Test description</p>",
        "start_date": "2026-01-02",
        "target_date": "2026-01-04",
        "completed_at": "2026-05-04T12:14:24.907542-04:00",
        "state": "3dd0f6a1-ead7-44ee-af95-1197eb501225",
    }

    Note that completed_at has been updated to the current date.

Environment

Production

Browser

None

Variant

Self-hosted

Version

v1.3.0

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