HarryChen / bzjira

0 stars 8 forks source link

Fix when adding a long attachment file name, jira server return 500. #19

Closed RodChen closed 5 years ago

RodChen commented 5 years ago

Solution: ensure filename is at most 255 by truncating filename

Sample response: jira.exceptions.JIRAError: JiraError HTTP 500 url: http://qcloud-jira.qnap.com.tw:8080/rest/api/2/issue/INF-4126/attachments text: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:FileAttachment][filename,VERYLONG.png][issue,86321][author,robot][created,2019-09-18 10:36:52.242][mimetype,image/png][filesize,646792][id,42606] (SQL Exception while executing the following:INSERT INTO fileattachment (ID, issueid, MIMETYPE, FILENAME, CREATED, FILESIZE, AUTHOR, zip, thumbnailable) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) (Data truncation: Data too long for column 'FILENAME' at row 1))