diff --git a/mcp_server.py b/mcp_server.py index f2918f8..692c47f 100644 --- a/mcp_server.py +++ b/mcp_server.py @@ -225,6 +225,7 @@ def update_ticket( status: str = "", type: str = "", user: str = "", + startup_script: str = "", parent_id: int = -1, effort: int = -1, environment_id: int = -1, @@ -240,6 +241,10 @@ def update_ticket( status: open, ongoing, completed, abandoned. type: feature, bug, chore, project. user: kevin or claude. + startup_script: Override the auto-generated claude startup command. + Pass the full claude "..." --allowedTools "..." string. + When omitted but title/description/type changes, the + script is regenerated automatically. 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. @@ -259,11 +264,16 @@ def update_ticket( 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: + if not body and not startup_script: raise ValueError("Provide at least one field to update") with _client() as c: - ticket = _check(c.patch(f"/api/tickets/{ticket_id}", json=body)) - if title or description or type: + if body: + ticket = _check(c.patch(f"/api/tickets/{ticket_id}", json=body)) + else: + ticket = _check(c.get(f"/api/tickets/{ticket_id}")) + if startup_script: + ticket = _check(c.patch(f"/api/tickets/{ticket_id}", json={"startup_script": startup_script})) + elif title or description or type: script = _generate_startup_script( ticket["id"], ticket["human_id"], ticket["title"], ticket["description"], ticket["type"],