您能否帮助获取特定问题的标签和冲刺值
import jira.client
from jira.client import JIRA
options = {'server': 'https://example.com', 'verify':False}
jira = JIRA(options, basic_auth=('user', 'password'))
issues_in_project = jira.search_issues('project=11372 AND SPRINT not in
closedSprints() AND sprint not in futureSprints()')
for value in issues_in_project:
print value.key , value.fields.summary , value.fields.assignee ,
value.fields.reporter ,value.fields.updated ,value.fields.resolutiondate,
value.fields.duedate, value.fields.labels,value.fields.tag
运行 python 脚本时,出现错误
DWD-9933 加载和验证产品用户名用户名 2018-04-02T23:27:07.000-0700 无 2018-04-06 [u'DW-Products'] 追溯(最近一次调用):文件“jira_test.py”,行23、在打印 value.key , value.fields.summary , value.fields.assignee , value.fields.reporter ,value.fields.updated ,value.fields.resolutiondate, value.fields.duedate, value.fields.labels, value.fields.tag AttributeError: 类型对象“PropertyHolder”没有属性“tag”
请看一次并帮助我实现这一目标
谢谢,
对于标准属性,使用getattr
带有field
名称的内置方法(技术上是id
)。一些字段可以是自定义的,它们id
看起来像这样customfield_15100
。这是获取JSON
所有字段信息的方法https://confluence.atlassian.com/jirakb/how-to-find-id-for-custom-field-s-744522503.html。
所以在你的情况下,tag
可能是一个自定义字段。
for value in issues_in_project:
# standart field
print(getattr(value.fields(), 'reporter'))
print(getattr(value.fields(), 'summary'))
# custom field
print(getattr(value.fields(), 'customfield_15100'))
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句