debug_issue_fields
Analyze and troubleshoot JIRA issue field configurations to identify and resolve data display or validation problems.
Instructions
调试JIRA问题字段
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issue_key | Yes |
Implementation Reference
- src/jira_mcp/server.py:454-507 (handler)Implementation of the debug_issue_fields tool: MCP tool handler that inspects and returns the field structure of a JIRA issue for debugging purposes.@mcp.tool( description="调试JIRA问题字段", ) def debug_issue_fields( issue_key: str, ) -> Dict[str, Any]: """查看JIRA问题的字段结构,用于调试. Args: issue_key: JIRA问题键 Returns: Dict[str, Any]: 字段结构信息 """ logger.info(f"调试问题字段: {issue_key}") try: client = get_jira_client() issue = client.issue(issue_key) fields = [] for field_name in dir(issue.fields): if field_name.startswith('_') or callable(getattr(issue.fields, field_name)): continue value = getattr(issue.fields, field_name) field_type = type(value).__name__ if field_name in ('attachment', 'attachments'): if value: attachment_info = [] for att in value: attachment_info.append({ "id": getattr(att, "id", None), "filename": getattr(att, "filename", None), "size": getattr(att, "size", None), "content_type": getattr(att, "mimeType", None), "created": getattr(att, "created", None), }) fields.append({"name": field_name, "type": field_type, "value": attachment_info}) else: fields.append({"name": field_name, "type": field_type, "value": None}) else: # 对于其他字段,仅显示类型信息和简单值 simple_value = str(value)[:100] if value is not None else None fields.append({"name": field_name, "type": field_type, "preview": simple_value}) return { "id": issue.id, "key": issue.key, "fields": sorted(fields, key=lambda x: x["name"]) } except Exception as e: logger.error(f"调试问题 {issue_key} 字段失败: {str(e)}") return {"error": str(e)}
- src/jira_mcp/server.py:454-456 (registration)MCP tool registration decorator for debug_issue_fields.@mcp.tool( description="调试JIRA问题字段", )