Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Python library jira - access changelog.histories item "from"

preznicek
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 25, 2025

Hello

If I access jira data via Python library "jira" - in changelog.histories the item "from" is unavailable regardless items list structure is:
field
fieldType
from
fromString
to
toString

It raises "SyntaxError: f-string: expecting '=', or '!', or ':', or '}'"
Example:

 

            for history in changelog.histories:
                for item in history.items:
                    if hasattr(item, "from"):
                        print(f"item.from: {item.from}")

1 answer

0 votes
Tuncay Senturk _Snapbytes_
Community Champion
March 25, 2025

Hi @preznicek 

As far as I know from is a reserved keyword in Python, so you may not access it directly as an attribute using item.from

Instead, can you try something like the one below?

 

for history in changelog.histories:
for item in history.items:
if hasattr(item, "from"):
print(f"item.from: {getattr(item, 'from')}")

 

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, team ’25 europe, early bird extension, conference discount, barcelona, hybrid event, AI teamwork, early bird pass, digital access, collaboration conference, atlassian events, register now, developer conference

1 week left to save on your Team '25 Europe pass

Still thinking about joining us for Team '25 Europe? Early bird has been extended for just one week! Now’s the time to lock in your lowest rate. Use code TEU25COMM-20 to save 20% at checkout. Hurry, this only lasts for 1 more week.

Learn more
AUG Leaders

Atlassian Community Events