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

Creating Issue via v3 API fails if Multi-line Text Field is defined

XMLWordPrintable

      Description

      Some of Jira's text fields such as Description, use Atlassian Document Format to format its content.

      When creating issues through the API, the request will fail if Multi-Line Text Custom Fields are defined due to unsupported content.

      {"errorMessages":["We can't create this issue for you right now, it could be due to unsupported content you've entered into one or more of the issue fields. If this situation persists, contact your administrator as they'll be able to access more specific information in the log file."],"errors":{}}
      

      Steps to reproduce

      1. Create a Multi-Line text field
      2. Try creating an issue setting a value for this field (This value will need to be compliant to the ADF format) using the POST - Create Issue endpoint
        • Example of request
          curl -D- -u <emailAddress>:<apiToken> -X POST -H "Content-Type: application/json" -d '{"fields": {"project":{"name":"Test Project Kanban","key":"TPK"},"summary": "Test ADF API","customfield_10225":{"version":1,"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"Testing data in ADF"}]}]},"description": {"type": "doc","version": 1,"content": [{"type": "paragraph","content": [{"type": "text","text": "This is a Description"}]}]}, "issuetype":{"id":"10100"}}}' https://<instance>.atlassian.net/rest/api/3/issue
          

      Expected results

      Issue is created

      Actual results

      Request fails with 400 error and the following message is presented:

      {"errorMessages":["We can't create this issue for you right now, it could be due to unsupported content you've entered into one or more of the issue fields. If this situation persists, contact your administrator as they'll be able to access more specific information in the log file."],"errors":{}}
      

      Workaround

      Use REST API v2., as this version does not require ADF formatting. In this case, the request will be something similar to the following:

      curl -D- -u <emailAddress>:<apiToken> -X POST -H "Content-Type: application/json" -d '{"fields": {"project":{"name":"Test Project Kanban","key":"TPK"},"summary": "Test ADF API","customfield_10225":"Testing data in ADF","description": "This is a Description", "issuetype":{"id":"10100"}}}' https://<instance>.atlassian.net/rest/api/2/issue
      

              jchen2@atlassian.com Jimmy (Inactive)
              lhubert@atlassian.com Leonardo H
              Votes:
              2 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: