update_issue
Modifies details of an existing issue in Taiga project management through the MCP Bridge, enabling precise issue updates with session and issue IDs.
Instructions
Updates details of an existing issue.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issue_id | Yes | ||
| kwargs | Yes | ||
| session_id | Yes |
Implementation Reference
- src/server.py:687-721 (handler)The handler function for the MCP tool 'update_issue'. It validates the session, fetches the current issue to get its version, and calls the Taiga API's issues.edit method to update the issue with the provided kwargs.@mcp.tool("update_issue", description="Updates details of an existing issue.") def update_issue(session_id: str, issue_id: int, **kwargs) -> Dict[str, Any]: """Updates an issue. Pass fields to update as keyword arguments (e.g., subject, description, status_id, assigned_to).""" logger.info( f"Executing update_issue ID {issue_id} for session {session_id[:8]} with data: {kwargs}") taiga_client_wrapper = _get_authenticated_client(session_id) # Use wrapper variable name try: # Use pytaigaclient edit pattern for partial updates if not kwargs: logger.info(f"No fields provided for update on issue {issue_id}") return taiga_client_wrapper.api.issues.get(issue_id) # Get current issue data to retrieve version current_issue = taiga_client_wrapper.api.issues.get(issue_id) version = current_issue.get('version') if not version: raise ValueError(f"Could not determine version for issue {issue_id}") # Use edit method for partial updates with keyword arguments updated_issue = taiga_client_wrapper.api.issues.edit( issue_id=issue_id, version=version, **kwargs ) logger.info(f"Issue {issue_id} update request sent.") return updated_issue except TaigaException as e: logger.error( f"Taiga API error updating issue {issue_id}: {e}", exc_info=False) raise e except Exception as e: logger.error( f"Unexpected error updating issue {issue_id}: {e}", exc_info=True) raise RuntimeError(f"Server error updating issue: {e}")
- src/server.py:39-52 (helper)Helper function used by 'update_issue' (and other tools) to retrieve and validate the authenticated Taiga client for the session.def _get_authenticated_client(session_id: str) -> TaigaClientWrapper: """ Retrieves the authenticated TaigaClientWrapper for a given session ID. Raises PermissionError if the session is invalid or not found. """ client = active_sessions.get(session_id) # Also check if the client object itself exists and is authenticated if not client or not client.is_authenticated: logger.warning(f"Invalid or expired session ID provided: {session_id}") # Raise PermissionError - FastMCP will map this to an appropriate error response raise PermissionError( f"Invalid or expired session ID: '{session_id}'. Please login again.") logger.debug(f"Retrieved valid client for session ID: {session_id}") return client
- src/server.py:687-687 (registration)The @mcp.tool decorator registers the 'update_issue' function as an MCP tool.@mcp.tool("update_issue", description="Updates details of an existing issue.")