From 018f2f40a20339bcd0183c9efae0b4eed99a6295 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 26 May 2026 22:01:52 +0000 Subject: [PATCH] feat: add environment_id to update_ticket MCP tool MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allows reassigning tickets between environments (e.g. HOME → GAME). create_ticket and list_tickets already supported environment_id. Co-Authored-By: Claude Sonnet 4.6 --- mcp_server.py | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/mcp_server.py b/mcp_server.py index 94974c7..c2232ad 100644 --- a/mcp_server.py +++ b/mcp_server.py @@ -229,30 +229,33 @@ def delete_ticket(ticket_id: int) -> dict: @mcp.tool() def update_ticket( - ticket_id: int, - title: str = "", - description: str = "", - status: str = "", - type: str = "", - user: str = "", - parent_id: int = -1, - effort: int = -1, + ticket_id: int, + title: str = "", + description: str = "", + status: str = "", + type: str = "", + user: str = "", + parent_id: int = -1, + effort: int = -1, + environment_id: int = -1, ) -> dict: """ Update an existing homelab ticket. Only provided (non-empty) fields are changed; omit a field to leave it unchanged. Args: - ticket_id: The integer ID of the ticket to update. - title: New title. - description: New markdown description. - status: open, ongoing, completed, abandoned. - type: feature, bug, chore, project. - user: kevin or claude. - parent_id: Set parent ticket ID; pass 0 to clear the parent. - Omit (default -1) to leave unchanged. - effort: Effort rating 1–10; pass 0 to clear it. - Omit (default -1) to leave unchanged. + ticket_id: The integer ID of the ticket to update. + title: New title. + description: New markdown description. + status: open, ongoing, completed, abandoned. + type: feature, bug, chore, project. + user: kevin or claude. + parent_id: Set parent ticket ID; pass 0 to clear the parent. + Omit (default -1) to leave unchanged. + effort: Effort rating 1–10; pass 0 to clear it. + Omit (default -1) to leave unchanged. + environment_id: Move ticket to a different environment by ID. + Omit (default -1) to leave unchanged. """ body = {} if title: body["title"] = title @@ -264,6 +267,8 @@ def update_ticket( body["parent_id"] = parent_id if parent_id > 0 else None if effort >= 0: body["effort"] = effort if effort > 0 else None + if environment_id >= 0: + body["environment_id"] = environment_id if environment_id > 0 else None if not body: raise ValueError("Provide at least one field to update") with _client() as c: