1

我正在尝试使用以下表达式来检索有关 JIRA 票证的数据jira-python,包括链接:

issue = self.jira.search_issues("key=MYPR-11", fields=["links", "worklogs", "created","timetracking", "updated", "status", "Severity", "priority", "type", "fixVersions", "affectedVersions","components", "labels", "reporter", "assignee"])

但是在查看可用字段时,似乎缺少“链接”:

print(dir(issue.fields))
['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'assignee', 'components', 'created', 'customfield_10010', 'fixVersions', 'issuetype', 'labels', 'priority', 'reporter', 'status', 'timetracking', 'updated']

知道如何使用“jira-python”查询“链接”信息吗?

4

1 回答 1

2

我不太确定您想要什么links,但我认为您需要问题链接。您使用了错误的字段名。而不是links字段被调用issuelinks

issue = self.jira.search_issues("key=MYPR-11", fields=["issuelinks", "worklogs", "created","timetracking", "updated", "status", "Severity", "priority", "type", "fixVersions", "affectedVersions","components", "labels", "reporter", "assignee"])

如果您想拥有所有可用字段,请尝试*all包含所有字段。 https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/issue-getIssue

我不确定是否jira-python支持这个

编辑

正如@Alex 提到的:如果没有指定字段,则返回所有可用字段。

于 2017-02-06T09:10:39.957 回答