1

我正在使用 jira-python 模块,但无法弄清楚如何检索 Jira 问题链接的创建日期(inwardIssue,outwardIssue)

我查看了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']

任何指针将不胜感激。

谢谢

- 安德鲁

4

2 回答 2

1

对于给定的问题,创建日期是:

issue.fields.created
于 2017-09-08T17:59:27.657 回答
0

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))
于 2018-08-29T03:33:25.513 回答