Details
-
Bug
-
Resolution: Fixed
-
Medium
-
6
-
Severity 3 - Minor
-
Description
Issue Summary
If an attachment upload (e.g. via REST API) does not send a MIME type during its creation, the file will not be displayed in the new issue view afterwards.
Environment
Jira Cloud.
Steps to Reproduce
- Add an attachment via REST API (using Python);
- E.g.:
r = requests.post(response['self'] + '/attachments', auth=jira_auth, headers = {'X-Atlassian-Token': 'no-check'} , files= {'file': (not_on_tt_trunc[i], open(not_on_tt[i],'rb'))} )
- E.g.:
- The file may appear in the issue at first, bit they will disappear at an action is taken in the issue.
Expected Results
The file would be still displayed in the issue despite ay actions taken.
Actual Results
The attachment is not displayed in the new issue view.
Notes
The file will work in the old issue view.
Workaround
Make sure a MIME type is added to the file upon the request.
This is an example of how to make it work:
r = requests.post(url, auth=jira_auth, headers = {'X-Atlassian-Token': 'no-check'}, files={'file':(file_name, open(file_name,'rb'), 'application/octet-stream')})
Special attention to the part 'application/octet-stream'.
Attachments
Issue Links
- relates to
-
JRACLOUD-22475 Prevent files from getting empty values for the "Mime Type" information
- Closed