It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Jira REST API v3 no longer excepts description as empty string

Creating an issue via the REST API v3 with description as empty string (like below) used to work until recently:

{'fields': {'project': {'id': xxx}, 'assignee': None, 'description': {'content': [{'content': [{'text': '', 'type': 'text'}], 'type': 'paragraph'}], 'version': 1, 'type': 'doc'}, 'issuetype': {'name': 'Story'}, 'labels': ['test1'], 'summary': 'Ticket'}}

 

Now returns: 400 - "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."

 

Just setting the description allows the request to succeed:

{'fields': {'project': {'id': xxx}, 'assignee': None, 'description': {'content': [{'content': [{'text': 'SOMETHING HERE', 'type': 'text'}], 'type': 'paragraph'}], 'version': 1, 'type': 'doc'}, 'issuetype': {'name': 'Story'}, 'labels': ['test1'], 'summary': 'Ticket'}}

Is there somewhere breaking changes like this are posted and kept track of for us developers that are at the mercy of these changes?

1 answer

Do you still get the error if you don't specify anything for the description, as in:

{'fields': {'project': {'id': xxx}, 'assignee': None, 'type': 'paragraph'}], 'version': 1, 'type': 'doc'}, 'issuetype': {'name': 'Story'}, 'labels': ['test1'], 'summary': 'Ticket'}} 

OK, now try setting the description directly, without setting the other values, like content and type etc, as in:

{'fields': {'project': {'id': xxx}, 'assignee': None, 'description': '', 'issuetype': {'name': 'Story'}, 'labels': ['test1'], 'summary': 'Ticket'}}

This is the method I use, but that's for Jira Server, not cloud.

This issue might be related to the use of the description field now being in ADF format, so they might have added a sanity check that, if you define a description in the new format, it must have some content, not nothing.

If that turns out to be the case, you'd have to alter your code to check if the description was empty first, then only add its definition to the request body if it's not nothing.

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you