Hi I am using this code to extract all issues from Jira
for issue in jira_issues:
try:
for history in issue.changelog.histories:
for item in history.items:
d = {
'id': issue.id,
'keyId': issue.key,
'Total_change': issue.changelog.total,
'Ticket_created': str(issue.fields.created)[:23],
'Proj_id': issue.fields.project.id,
'Proj_name': issue.fields.project.name,
'Proj_key': issue.fields.project.key,
'Status_name': issue.fields.status.name,
'Status_cat': issue.fields.status.statusCategory.key,
'Status_col': issue.fields.status.statusCategory.colorName,
'Author': history.author,
'Issue_type': issue.fields.issuetype.name,
'Last_update': str(issue.fields.updated)[:23],
'Timestamp': str(history.created)[:23],
'FldName': item.field,
'From_': item.fromString,
'To_': item.toString
}
if d.keys():
issues = issues.append(d, ignore_index=True)
If the item has only one item.field the code is correct, but with multiple item.fields (status, time spent, assignee) the code is wrong because it is taking only the first one.
What can I do to get all item.fields instead only the first one?