-
Bug
-
Resolution: Fixed
-
Low
-
None
-
3
-
Severity 2 - Major
-
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
- Create a Multi-Line text field
- 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
- Example of request
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
- resolves
-
JST-494471 Loading...