Trasition issue rest call fails when also adding a comment

Hi,

For an app I develop I want to optionally add a comment when transitioning an issue. If I look at the REST docs the I should be able to add a comment using the field operation “add” in the update section of the request body.

However when I add the comment in the Atlassian Document Format like below I get a 400 comment not valid error:

"update": {
    "comment": [
      {
        "add": {
          "body": {
            "type": "doc",
            "version": 1,
            "content": [
              {
                "type": "paragraph",
                "content": [
                  {
                    "text": "Bug has been fixed",
                    "type": "text"
                  }
                ]
              }
            ]
          }
        }
      }
    ]
  }

When I add the comment operation like below I don’t get any error but the comment is also not added to the issue:

"update": {
    "comment": [
      {
        "add": {
            "type": "doc",
            "version": 1,
            "content": [
              {
                "type": "paragraph",
                "content": [
                  {
                    "text": "Bug has been fixed",
                    "type": "text"
                  }
                ]
              }
            ]
        }
      }
    ]
  }

I know the content of the field operation is correctly formatted for adding the comment because I can post the “body” of the first code snippet to the add comment REST API and it will add the comment without issue.

Is there something I’m missing when trying to add a comment to an issue when transitioning it using the REST API?

By the way, I found a workaround by removing the comment from the transition request body and post is ‘manually’ when the transition is successful.

Cheers,
Mark