有没有办法使用 python JIRA 库在 JIRA 中获取冲刺的开始和结束日期?我可以得到 jira.client.ResultList
使用 jira.sprints(jira.boards()[<sequence number of the board of interest>].id)
与感兴趣的董事会内的所有冲刺.该列表如下所示:
[<JIRA Sprint: name='LSD Sprint 1', id=1>,
...
<JIRA Sprint: name='LSD Sprint 14', id=14>]
我能否使用类似于 issue.fields
的方式以某种方式访问每个冲刺的开始和结束日期?返回我 jira.resources.PropertyHolder
,我可以从中访问其他数据?
最佳答案
为了测试,我使用了jirashell
(python-jira 1.0.10
)、JIRA 6.3.11
、JIRA 7.2.3
,JIRA AGILE REST API v1.0
。我在 jirashell
中运行了以下代码:
dir(jira.sprints(jira.boards()[0].id)[0])
它打印sprint
对象的所有方法和属性:
['AGILE_BASE_REST_PATH',
'AGILE_BASE_URL',
'AGILE_EXPERIMENTAL_REST_PATH',
'GREENHOPPER_REST_PATH',
'JIRA_BASE_URL',
'_READABLE_IDS',
'__class__',
'__delattr__',
'__dict__',
'__doc__',
'__format__',
'__getattr__',
'__getattribute__',
'__hash__',
'__init__',
'__module__',
'__new__',
'__reduce__',
'__reduce_ex__',
'__repr__',
'__setattr__',
'__sizeof__',
'__str__',
'__subclasshook__',
'__weakref__',
'_base_url',
'_default_headers',
'_get_url',
'_load',
'_options',
'_parse_raw',
'_resource',
'_session',
'delete',
'find',
'id',
'linkedPagesCount',
'name',
'raw',
'self',
'sequence',
'state',
'update']
如您所见,该列表不包含 startDate
或 endDate
属性。尽管如此,快速搜索 sprint startDate and endDate properties via JIRA REST API显示 API 确实支持此类属性。但事实证明,python-jira
使用旧版本的 JIRA AGILE REST API。例如,当我运行 jira.sprints(jira.boards()[0].id)[0].self
时,我得到 https://[JIRA_URL]/rest/greenhopper结果是/1.0/sprint/[ID]
(不是 agile/1.0,如 API 支持 startDate 和 endDate 属性的答案中提到的那样)。此外,python-jira
会抛出一条消息 Old private GreenHopper API is used, all parameters will be ignored
。
因此,我认为由于旧版本的 JIRA AGILE API,无法使用 python-jira
获取 startDate
和 endDate
它使用的。
关于jira - 使用 python JIRA 库检索 JIRA sprint 的开始日期和结束日期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45818160/