无法访问 JIRA 项目的"from"属性



在访问JIRA时,我正在尝试访问项的from属性。Python给了我一个语法错误。可能是什么问题?

for history in changelog.histories:
for item in history.items:
if (item.field.upper() == 'SPRINT'):
try:
if item.fromString:
sFromSprint = str(100) #python does not like item.from
else:
sFromSprint = str(iZERO)    

错误:

iFromSprint = item.from
^
SyntaxError: invalid syntax

from是python 中的保留关键字

您可以使用getattr(item,'from')来获取属性。

最新更新