swingbit / jira2gitlab

Migrate Jira projects into a Gitlab instance
MIT License
20 stars 11 forks source link

replacements = move_attachments(issue['fields']['attachment'], gitlab_project_id) KeyError: 'attachment' #24

Closed ptbuchanan21 closed 8 months ago

ptbuchanan21 commented 8 months ago

File "./jira2gitlab.py", line 959, in migrate_project(jira_project, gitlab_project) File "./jira2gitlab.py", line 567, in migrate_project replacements = move_attachments(issue['fields']['attachment'], gitlab_project_id) KeyError: 'attachment'

I am getting this error on line 567. Do you know why it would be breaking here? My project does have attachments, reading into Jira's API if something had changed.

swingbit commented 8 months ago

I'm not sure why this would happen. I've migrated hundreds of thousands of issues from Jira, and the field always existed, no matter whether attachments were there or not.

In any case, I added a guard. It can't hurt and hopefully solves the issue.

ptbuchanan21 commented 8 months ago

That fixed the issue, getting a 403 error but I most likely will be able to sort through that. Anyways, thank you for that addition!