programmiersportgruppe / jira-sync

A suite of command line utilities to synchronise jira projects to the local file system
MIT License
15 stars 12 forks source link

Randomly skips attachments (Jira API problem) #10

Open ghost opened 8 years ago

ghost commented 8 years ago

This is a problem with the Jira API, not jira-sync as such, but am putting it here in case anyone knows a solution.

The json downloaded for issues which display on the corresponding Jira web page with attachments often contains no attachments section. As a result, jira-sync does not attempt to download any attachments for such issues. The attachment-less json is also fetched using Curl and so is not caused by jira-sync.

This is consistent per issue, not intermittent. I can find no difference between the issues where the attachment section is not returned and those where it is by looking at the html source. It appears to happen more on older (pre 2010) issues, but this is hard to check systematically without screen-scraping the issue web pages.

ghost commented 8 years ago

Problem seems to be this bug in the Jira API (formally 'resolved', but scroll down to the comments to see that it isn't):

https://jira.atlassian.com/browse/JRA-27637

See also:

https://jira.atlassian.com/browse/JRA-31781

where Atlassian officially say they won't fix the problem

ghost commented 8 years ago

The only way round this I could find was scraping each page with no attachments in the json export, checking for attachments, and if any found, reconstructing a minimal bit of json from the html and inserting it in the main json file so that the attachment gets downloaded. Clunky and not sure if it generalises to all releases of Jira, so have not made a pull request for it (but available in the 'scraper' branch of my jira-sync github fork if wanted).