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

Python获取Jira子任务描述失败问题求助

问题:Python获取Jira子任务描述字段缺失

我用Python获取Jira子任务的描述信息时遇到问题——主任务的所有信息(包括摘要、状态、描述、子任务列表等)都能正常获取,但获取特定子任务数据时,description字段始终缺失。

代码示例(遍历主任务子任务时的问题)

ticket_data = jira.issue("PROJ-12345")
for subtask in ticket_data.fields.subtasks:
    if "generate data" in (subtask.fields.summary).lower():
        st_desc = subtask.fields.description      # 报错:找不到该字段
        print(subtask.raw['fields'])               # 输出中没有description字段

尝试过的解决方法(均无效)

  • 直接单独请求子任务数据,结果和从主任务中获取的一致,仍然没有description字段:
subtask_data = jira.issue(subtask_key, fields='description')
print(subtask_data.raw['fields'])       # 返回数据中依然没有description字段
  • 确认子任务本身是有描述的,我可以正常创建带描述的子任务,配置如下:
name: "subtask_1"
project: "PROJ"
summary: "Generate data for the given task"
assignee: "myself@email.com"
description: "All the data I need for the description entered here"
issuetype: "Sub-task"
parent: "PROJ-12345"

我查了相关帖子但没找到解决方案,想问问:问题到底出在哪里?

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.26 09:42:04