Issue is not updating..facing Error: {"size":0,"timeout":0} - Bad Request

Hi Team, I am trying to update my primary issue.here i am getting
ERROR 13:23:32.519 d86df3a5-d37c-4cac-abd8-bc80a28c865a Error: {“size”:0,“timeout”:0} - Bad Request.what is the mistake in this.can you share your ideas?
my request payload

  // Merge description
  const mergedDescription = `${primaryIssue.fields.description}\n\n---\n\n${secondaryIssue.fields.description}`;

  // Update the primary issue with merged details
  let response = await api.asApp().requestJira(route`/rest/api/3/issue/10119`, {
    method: 'PUT',
    headers: {
      'Accept': 'application/json',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      fields: {
        // description: mergedDescription,
         "description": "Updated description"
      }
    })
  });

Hi @Dhurgeswari,

Since you are using the REST API V3, the issue description field requires it to be in ADF format, otherwise, an error will be thrown.

To fix this you can either:

  1. Use REST API V2 i.e., /rest/api/2/issue/{issueKeyOrId}. This will suffice if you are just going to use simple text in your description.
  2. Or, you can still use V3 but change the description to use ADF. Here’s an example:
   "description": {
      "type": "doc",
      "version": 1,
      "content": [
        {
          "type": "paragraph",
          "content": [
            {
              "type": "text",
              "text": "This is a valid description"
            }
          ]
        }
      ]
    }

Do try it out and let us know how it goes.

Ian

1 Like

There’s also ADF libraries: https://developer.atlassian.com/cloud/jira/platform/apis/document/libs/

2 Likes

thank you @ianRqgudo .its works fine to me.thanks for your support

1 Like