-
-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attachments fail to download from Jira #851
Comments
Same problem here. Version 3.0.85 is a long ways back, so using it isn't a workaround option since it had other problems.
In this case, one image was inline in the description, and the other was dragged into JIRA as a file attachment. |
Ah, glad it's not just me! Thanks for the added info @RPainter8West |
Check the History of the Jira Issue. Do you notice anything out of the ordinary? For example, was the attachment removed before it was added, or anything like that? |
No these are very simple image additions. In my example, one was pasted into the description field, and the other was dragged on as an attachment. I did this just before doing the export. Probably 10% of my items have at least one image attached. I am not getting any images exported. |
Hi @Alexander-Hjelm, I have a range of attachments including word docs and outlook messages and these haven't been removed and re-added either. None of them will download successfully from a project. But they do using 3.0.85 |
I've just modified the logic and it seems to work as intended:
Now if I add an attachment, it will download it successfully and if I delete the attachment, it will add the relevant comment to the log and not try to download it |
Perfect! Happy to hear that you managed to resolve your problem. I will review these changes as soon as I find the time, and then look at incorporating them into the main line. Feel free to raise a PR if you want to be included as a contributor. |
@nickn00 are you putting in a PR for this fix? Or @Alexander-Hjelm do you have an idea when a fix will be available? |
@Alexander-Hjelm @RPainter8West I've just created PR #867 for review |
Perfect. I will try and find the time to review and test your change this week! |
Thanks @nickn00 ! I downloaded your fork, and it solved my problem. |
@C-F-Palmer reported issue separately in #952 Have you noticed anything particular in the issue itself in Jira? If you check the history of the concerned issue, does it seem like the attackment has been added in any unconventional way? For example, maybe if you check the order of the history, it could say that the attachment was simply added, swapped for another file, deleted and then re-added, or anything else? I'm trying to think of any edge cases that we possibly haven't covered. |
Hi Alexander, There is nothing obvious in the history audit trail that suggest that the attachments were added or re-added in a peculiar way. There are 76 attachments in the issue I am trying to export which have been added between 2008 and 2023 and not one single attachment exported. I did the export again using version 3.0.85 which I had used for a previous migration and the attachments exported as expected. It seems something has changed between build 85 and 328? The version of Jira I am migrating is 7.11. |
Hi ALexander, Just thinking about this some more and I was wondering if the Attachment Path in Jira could be causing this issue? In our Jira instance the Attachment Path is set to "Use Custom Directory" instead of the "Use Default Directory" option. |
@C-F-Palmer, that sounds like a plausible culprit, but it would be completely bonkers if changing the Attachment Path changes the behavior of the /issue API.... :/ Could you download Visual Studio (https://visualstudio.microsoft.com/vs/community/) and build the source code? If so, let us schedule a Teams meeting for remote debugging. Maybe we can better identify the problem that way. You can email me at [email protected] with some suggestions for meeting times. My time zone is CET. |
Hi Alexander, I am going to do one more test before moving onto your suggestion above to debug the problem. As you see from the images below our settings for attachments seem to vary from screen to screen in Jira: From the System screen in Jira:You can see that the attachment path states "C:\Program Files\JIRA_attachments" which I believe at some point in time our IT Team created when upgrading or migrating servers. When you "Edit Settings" on this screen you get the following dialog opening:As you see the "Attachment Path" is set to "Use Custom Directory" and is pointing to a completely different path. It is also disabled and can't be amended. The other option "Use Default Directory" is enabled but this path does not match the path we are using as shown in the first attachment. So I will populate the "Default Directory" path with attachments and see if that solves the problem. |
Hi Alexander, What I have stated above has not worked. This kind of makes sense as the attachments do come across in the previous version 3.0.85. Below are extracts from the Export.json files from each version and the Export Jira Logs: LIC-1.json (version 3.0.85) works{ JIra Export Log extract: [D][11:15:12] Link with description 'This issue Is Replaced by LIC-221' is either not found or this issue (LIC-1) is not inward issue. LIC-1.json (version 3.0.334) doesn't work{ Jira Export Log extract: [D][11:07:28] Link with description 'This issue Is Replaced by LIC-221' is either not found or this issue (LIC-1) is not inward issue. |
@C-F-Palmer Ok! That's really interesting. It seems that the recommendation nowadays is to always use the default path. Not sure why, if it has something to do with managing folder permissions and ensuring that no Jira Server data is written to disk outside of the default folder, where user file permissions could be less restricted... Try it and let me know how it goes. |
.
|
Does the suggested fix by @TKallem work for either of you, by any chance? See #1049 (comment) |
Sorry @Alexander-Hjelm, I haven't had a need to keep up with this issue. In Oct 2023 I used a fork of this project by @nickn00 that sorted the problem out for me. I only needed to do this transition one time. |
Hi Alexander, The suggested fix by TKallem seems to have sorted this problem. I just ran an export on version 3.0.420 with the setting in Jira set to "Show" and the attachments appeared in the Export folder as expected. When I changed this setting back to "Hide" in Jira and run the same export again the "Attachments" folder did not appear in the Export folder and the log stated the error "cannot be migrated as file was deleted". However this does not explain why the attachments export correctly in version 3.0.85 with the Jira setting at "Hide" and not in any version after this? This may be where the issue was introduced. Thanks Chris |
@C-F-Palmer Agreed! In that case it seems strange that v3.0.85 would function just fine even for hidden attachments. Still, I think that this is a very important finding. Thank you for the help with checking. I will continue investigating on the side, as my time allows! |
Describe the problem
When I run the latest Jira export tool, it fails to download Attachments within issues on Jira (please see attached screenshots). I've found that the last version to download them successfully is 3.0.85, so I think it may be due to this previous bug fix: "Bugfix/do not try to migrate deleted attachments #618"
To Reproduce
Steps to reproduce the behavior:
Tool version
Attachments
Please attach the following files:
config-agile.json:
{
"source-project": "BAU RC200",
"target-project": "BAU IQT3",
"query": "project=BAURC ORDER BY Rank ASC",
"using-jira-cloud": false,
"workspace": "C:\Temp\JiraExport\",
"epic-link-field": "Epic Link",
"sprint-field": "Sprint",
"download-options": 2,
"batch-size": 20,
"log-level": "Debug",
"attachment-folder": "Attachments",
"user-mapping-file": "users.txt",
"base-area-path": "Migrated",
"base-iteration-path": "Migrated",
"ignore-failed-links": true,
"include-link-comments": false,
"process-template": "Agile",
"link-map": {
"link": [
{
"source": "Epic",
"target": "System.LinkTypes.Hierarchy-Reverse"
},
{
"source": "Parent",
"target": "System.LinkTypes.Hierarchy-Reverse"
},
{
"source": "Relates",
"target": "System.LinkTypes.Related"
},
{
"source": "Duplicate",
"target": "System.LinkTypes.Duplicate-Forward"
},
{
"source": "Child",
"target": "System.LinkTypes.Hierarchy-Forward"
}
]
},
"type-map": {
"type": [
{
"source": "Epic",
"target": "Epic"
},
{
"source": "Story",
"target": "Feature"
},
{
"source": "Bug",
"target": "Bug"
},
{
"source": "Story",
"target": "User Story"
},
{
"source": "Sub-task",
"target": "Task"
},
{
"source": "Certification Task",
"target": "Task"
},
{
"source": "Task",
"target": "Task"
},
{
"source": "Lab Request",
"target": "Task"
},
{
"source": "Review",
"target": "Task"
},
{
"source": "Test Request",
"target": "Task"
}
]
},
"field-map": {
"field": [
{
"source": "summary",
"target": "System.Title",
"mapper": "MapTitle"
},
{
"source": "assignee",
"target": "System.AssignedTo",
"mapper": "MapUser"
},
{
"source": "description",
"target": "System.Description",
"mapper": "MapRendered"
},
{
"source": "priority",
"target": "Microsoft.VSTS.Common.Priority",
"for": "Feature,Epic,User Story,Bug,Task",
"mapping": {
"values": [
{
"source": "Blocker",
"target": "1"
},
{
"source": "Critical",
"target": "2"
},
{
"source": "Major",
"target": "3"
},
{
"source": "Must have",
"target": "3"
},
{
"source": "Trivial",
"target": "4"
},
{
"source": "Minor",
"target": "4"
}
]
}
},
{
"source": "labels",
"target": "System.Tags",
"mapper": "MapTags"
},
{
"source": "comment",
"target": "System.History",
"mapper": "MapRendered"
},
{
"source": "status",
"target": "System.State",
"for": "Feature,Epic,User Story,Bug,Task",
"mapping": {
"values": [
{
"source": "Backlog",
"target": "New"
},
{
"source": "Selected for Work",
"target": "New"
},
{
"source": "In Progress",
"target": "Active"
},
{
"source": "On Hold",
"target": "Active"
},
{
"source": "Done",
"target": "Closed"
},
{
"source": "To Do",
"target": "New"
},
{
"source": "Removed",
"target": "Removed"
}
]
}
},
{
"source": "Story Points",
"source-type": "name",
"target": "Microsoft.VSTS.Scheduling.StoryPoints",
"not-for": "Task"
},
{
"source": "timeestimate",
"target": "Microsoft.VSTS.Scheduling.RemainingWork",
"mapper": "MapRemainingWork",
"for": "Bug,Task"
},
{
"source": "description",
"target": "Microsoft.VSTS.TCM.ReproSteps",
"for": "Bug"
}
]
}
}
Screenshots
If applicable, add screenshots to help explain your problem.
Thank you for looking into the bug. Hopefully it's replicatable! Let me know if you need any further details
Cheers
Nick
The text was updated successfully, but these errors were encountered: