Uploaded image for project: 'Jira Cloud'
  1. Jira Cloud
  2. JRACLOUD-72884

Creating an attachment with no MIME type will prevent the attachment from being displayed in the new issue view

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • Issue - View

      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'))}
          )
          
      • 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'.

            pkuo Peggy
            lalmeida@atlassian.com Leonardo De Almeida
            Votes:
            2 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: