Skip to content

fix(tickets): assignee silently dropped — send editorId, not assignedTo - #6

Open
bahit wants to merge 1 commit into
daniel-eder:mainfrom
bahit:fix/assigned-to-editor-id
Open

bahit wants to merge 1 commit into
daniel-eder:mainfrom
bahit:fix/assigned-to-editor-id

Conversation

@bahit

@bahit bahit commented Jul 30, 2026

Copy link
Copy Markdown

Problem

create_ticket and update_ticket expose an assignedTo parameter to set a ticket's assignee, but the value is silently dropped — tickets are created/updated with no assignee (editorId stays empty), with no error returned.

Root cause

Both methods spread assignedTo verbatim into the JSON-RPC values payload via **kwargs:

values = {"headline": ..., "projectId": ..., "userId": ..., "date": ..., **kwargs}

But Leantime's Tickets.Tickets.addTicket / updateTicket read the assignee from the editorId field, not assignedTo. The unrecognized key is ignored, so the assignment is lost.

Fix

Translate assignedTo → editorId in both create_ticket and update_ticket (pop it from kwargs, set values["editorId"]). The public tool parameter keeps the name assignedTo, so this is fully backward compatible — no schema or caller changes.

assigned_to = kwargs.pop("assignedTo", None)
values = {..., **kwargs}
if assigned_to is not None:
    values["editorId"] = assigned_to

Side note: userId (author)

While diagnosing this I confirmed that userId (the ticket author/owner) is server-enforced: Leantime ignores the userId value in values and sets the author to the API-key user, regardless of what is passed. That's server behavior and out of scope for this PR, but I updated the user_id tool description to document it so callers aren't misled into thinking it sets the author.

Verification

Tested end-to-end against Leantime 3.9.8 via the JSON-RPC API:

  • create_ticket(..., assignedTo=1) → resulting ticket has editorId: 1 (was "" before)
  • update_ticket(id, project, assignedTo=1) → editorId set to 1 (was "" before)

🤖 Generated with Claude Code

Leantime's addTicket/updateTicket read the assignee from `editorId`,
not `assignedTo`, so the `assignedTo` parameter was silently dropped
(the ticket was created/updated with no assignee). Translate
assignedTo -> editorId in both client methods.

Note: `userId` (the author/owner) is server-enforced to the API-key
user and cannot be overridden via the API, so create_ticket's `user_id`
parameter has no effect on the resulting ticket's author. Documented
this in the tool schema; to assign a ticket, use `assignedTo`.

Verified live against Leantime 3.9.8: create_ticket(assignedTo=1) and
update_ticket(assignedTo=1) both now set editorId correctly.

Co-Authored-By: Claude <noreply@anthropic.com>
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