0

I am trying to access the from property of an item while accessing JIRA. Python gives me a syntax error. What could be the problem?

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)    

Error:

    iFromSprint = item.from
                       ^
SyntaxError: invalid syntax
John Kugelman
  • 349,597
  • 67
  • 533
  • 578

1 Answers1

2

from is a reserved keyword in python

You can get the property using getattr(item,'from') instead.

bonhomme
  • 21
  • 2