我正在使用jira-python模块,但无法弄清楚如何检索 Jira 事务链接的创建日期(内部问题、向外事务(
我看着 https://jira.readthedocs.io/en/master/api.html 但似乎无法找到我要找的东西。
对于给定的问题链接,Python "dir((" 函数向我显示:
['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', 'inwardIssue', 'outwardIssue', 'raw', 'self', 'type', 'update']
任何指示将不胜感激。
谢谢
--安德鲁
对于给定的问题,创建日期为:
issue.fields.created
IssueLink
类型不包括有关它们何时"创建"的信息(在这种情况下是链接的时刻,而不是所述链接问题的创建(。此信息可以从问题的更改日志中抽象出来(例如:PROJECT-10(:
issue = jira.issue('PROJECT-10', expand='changelog')
for history in issue.changelog.histories:
for item in history.items:
if item.field == 'Link':
print("{} was linked to {} at {}".format(item.toString.split()[-1], issue, history.created))