update_issue
Modify JIRA issue details including summary, description, type, priority, assignee, and labels to keep work items current and accurate.
Instructions
更新JIRA问题
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issue_key | Yes | ||
| summary | No | ||
| description | No | ||
| issue_type | No | ||
| priority | No | ||
| assignee | No | ||
| labels | No |
Implementation Reference
- src/jira_mcp/server.py:329-389 (handler)The main handler function for the 'update_issue' tool. It updates the specified JIRA issue with optional fields like summary, description, issue_type, priority, assignee, and labels. Uses JIRA client to update and returns formatted issue details.def update_issue( issue_key: str, summary: Optional[str] = None, description: Optional[str] = None, issue_type: Optional[str] = None, priority: Optional[str] = None, assignee: Optional[str] = None, labels: Optional[List[str]] = None, ) -> Dict[str, Any]: """更新JIRA问题. Args: issue_key: 问题键 summary: 问题概要 description: 问题描述 issue_type: 问题类型 priority: 优先级 assignee: 经办人 labels: 标签列表 Returns: Dict[str, Any]: 更新后的问题详情 """ logger.info(f"更新问题 {issue_key}") try: # 构建更新字段 fields = {} if summary: fields["summary"] = summary if description: fields["description"] = description if issue_type: fields["issuetype"] = {"name": issue_type} if priority: fields["priority"] = {"name": priority} if assignee: fields["assignee"] = {"name": assignee} if labels: fields["labels"] = labels if not fields: return {"error": "未提供任何更新字段"} # 更新问题 client = get_jira_client() issue = client.issue(issue_key) issue.update(fields=fields) # 获取更新后的问题 updated_issue = client.issue(issue_key) return format_issue(updated_issue) except Exception as e: logger.error(f"更新问题 {issue_key} 失败: {str(e)}") return {"error": str(e)}
- src/jira_mcp/server.py:326-328 (registration)The @mcp.tool decorator registers the 'update_issue' function as an MCP tool with description '更新JIRA问题' (Update JIRA issue).@mcp.tool( description="更新JIRA问题", )