You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何便捷导出含全部步骤的Jira-Zephyr测试用例至Excel?

导出含Zephyr测试步骤的JIRA测试用例到Excel的解决方案
  • 调用Zephyr API提取并生成Excel
    利用Zephyr Scale/Squad的REST API获取测试步骤、测试数据、预期结果等专属字段,同时通过JIRA API拉取测试用例的基础信息(如描述、ID),再用脚本工具合并数据并导出为Excel。比如用Python+pandas实现的伪代码:

    import pandas as pd
    import requests
    
    # 替换为你的认证头和API地址
    auth_headers = {"Authorization": "Bearer YOUR_TOKEN", "Content-Type": "application/json"}
    test_case_id = "YOUR_TEST_CASE_ID"
    
    # 获取JIRA基础字段
    jira_res = requests.get(f"https://your-jira-instance/rest/api/2/issue/{test_case_id}", headers=auth_headers)
    jira_data = jira_res.json()
    
    # 获取Zephyr测试步骤
    zephyr_res = requests.get(f"https://your-jira-instance/rest/zephyr/latest/testcase/{test_case_id}/step", headers=auth_headers)
    zephyr_steps = zephyr_res.json()
    
    # 整理成表格数据
    rows = []
    for step in zephyr_steps:
        rows.append({
            "测试用例ID": test_case_id,
            "测试用例名称": jira_data["fields"]["summary"],
            "描述": jira_data["fields"]["description"],
            "步骤序号": step["id"],
            "测试步骤": step["description"],
            "测试数据": step.get("testData", ""),
            "预期结果": step["expectedResult"]
        })
    
    # 写入Excel
    df = pd.DataFrame(rows)
    df.to_excel("测试用例_带步骤.xlsx", index=False)
    
  • 使用JIRA Marketplace插件直接导出
    去JIRA应用市场搜索支持Zephyr字段导出的Excel插件,比如Zephyr Scale Excel Exporter、Test Management Excel Export,这类插件支持可视化选择需要导出的字段(包括Zephyr的测试步骤、数据等),无需代码就能一键导出符合需求的Excel文件。

  • XML导出后转Excel
    如果当前导出的XML包含Zephyr测试步骤信息,可以直接用Excel的「数据>自XML导入」功能解析文件,自动生成包含步骤的表格;如果XML结构复杂,也可以用Python的xml.etree.ElementTree模块提取字段后再生成Excel。

内容的提问来源于stack exchange,提问作者ChaimB

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.21 18:12:44