Skip to main content
Glama
yuezheng2006

Personal JIRA MCP

by yuezheng2006

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
NameRequiredDescriptionDefault
issue_keyYes
summaryNo
descriptionNo
issue_typeNo
priorityNo
assigneeNo
labelsNo

Implementation Reference

  • 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)}
  • The @mcp.tool decorator registers the 'update_issue' function as an MCP tool with description '更新JIRA问题' (Update JIRA issue).
    @mcp.tool(
        description="更新JIRA问题",
    )

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yuezheng2006/mcp-server-jira'

If you have feedback or need assistance with the MCP directory API, please join our Discord server