Failing to create Info Panel with Rest

im trying to create an info, bug or warning, panel but it keeps failing, does anybody know why, or can they provide a json example

https://BaseURLBlahBlahBlah/rest/api/3/issue/VIP-3484/comment

{
“body”: {
“content”: [
{
“attrs”: {
“isNumberColumnEnabled”: false,
“panelType”: “info”
},
“content”: [
{
“content”: [
{
“text”: “some text”,
“type”: “info panel”
}
],
“type”: “paragraph”
}
],
“type”: “panel”
}
],
“type”: “doc”,
“version”: 1
}
}

Response 400 Bad Request

{
“errorMessages”: [
“INVALID_INPUT”
],
“errors”: {}
}

Hi @MarcJeeves,

Welcome to our Atlassian Developer Community!

I just did a test with the following body and I could add an info panel as part of a comment to a Jira Cloud site.
Here is a screenshot for your reference:

  "body": {
    "content": [
      {
        "content": [
          {
            "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eget venenatis elit. Duis eu justo eget augue iaculis fermentum. Sed semper quam laoreet nisi egestas at posuere augue semper.",
            "type": "text"
          }
        ],
        "type": "paragraph"
      },
      {
        "content": [
          {
            "type": "paragraph",
            "content": [
              {
                "type": "text",
                "text": "Hello world"
              }
            ]
          }
        ],
        "type": "panel",
        "attrs": {
          "panelType": "info"
        }
      }
    ],
    "type": "doc",
    "version": 1
  }
}

In the example above, I’ve added some text to show how to add multiple nodes to a single comment but it’s 100% possible for the comment to contain just the info panel:

This is the corresponding body:

  "body": {
    "content": [
      {
        "content": [
          {
            "type": "paragraph",
            "content": [
              {
                "type": "text",
                "text": "Just an info panel"
              }
            ]
          }
        ],
        "type": "panel",
        "attrs": {
          "panelType": "info"
        }
      }
    ],
    "type": "doc",
    "version": 1
  }
}

Cheers,
Caterina

1 Like