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

Error rendering inline attachments in Issue Descriptions via /rest/api/3/issue/{issueIdOrKey}?fields=description&expand=renderedFields Endpoint

XMLWordPrintable

      Issue Summary

      When an inline attachment is added to the description of a Jira issue, and the issue is subsequently fetched through the API with the description field set to be rendered, the renderedFields property in the API response contains HTML error messages instead of properly rendering the attachment reference.

      Steps to Reproduce

      1. Create a new Jira issue.
      1. Add an inline attachment (for example, a zip file) to the issue's description. Ensure to change the view to display the attachment inline (see attached image: inline.jpeg)
      1. Perform a GET request to the Jira REST API to fetch the issue details, specifically requesting the description field and expanding the rendered fields. 
      1. curl --location 'https://yoursite.atlassian.net/rest/api/3/issue/TEST-11?fields=description&expand=renderedFields' \
        --header 'Accept: application/json' \
        --header 'Authorization: Basic xxxxx' \
        --header 'Cookie:' 

      Expected Results

      The renderedFields property in the API response should correctly display the inline attachment or a placeholder/link to it within the description, without any HTML error messages.

      Actual Results

      The renderedFields property, specifically the description field, contains HTML error messages. The expected inline attachment display is replaced with error codes within span tags indicating a failure to render the attachment correctly. An example of the erroneous output is as follows:

      "renderedFields": {
          "description": "<p>This is a test </p>\n\n\n\n<p><span class=\"error\">&#91;^524f6d51-e4fb-475b-9122-24e283d1a95f&#93;</span> </p>\n\n\n\n<p>inline </p>"
      } 

      Workaround

      Until a fix is deployed, a potential workaround is to avoid using inline attachments in issue descriptions where the content will be accessed via the API. Alternatively, accessing the description content directly (without rendering) still allows for manual parsing and handling, albeit with additional processing overhead.

              Unassigned Unassigned
              26a024868f5f Sherica Ocbania
              Votes:
              5 Vote for this issue
              Watchers:
              10 Start watching this issue

                Created:
                Updated: