# Atlassian CLI – Using a heading in Atlassian Document Format to create a comment returns an error

**URL:** <https://community.developer.atlassian.com/t/atlassian-cli-using-a-heading-in-atlassian-document-format-to-create-a-comment-returns-an-error/96638>\
**Category:** Atlassian Developer Tools\
**Created:** [November 2, 2025, 3:42pm UTC](https://community.developer.atlassian.com/t/atlassian-cli-using-a-heading-in-atlassian-document-format-to-create-a-comment-returns-an-error/96638 "2025-11-02T15:42:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![CedrickPlante](https://avatars.discourse-cdn.com/v4/letter/c/ecb155/32.png) [@CedrickPlante](https://community.developer.atlassian.com/u/CedrickPlante)\
**Post date:** [November 2, 2025, 3:42pm UTC](https://community.developer.atlassian.com/t/atlassian-cli-using-a-heading-in-atlassian-document-format-to-create-a-comment-returns-an-error/96638/1 "2025-11-02T15:42:03Z")

</div>

While trying to add a comment with a **heading node** on a work item using the CLI, I receive the following error:

> `Can't be edited: io.atlassian.micros.clibackend.exceptions.InvalidPayloadException: INVALID_INPUT, INVALID_INPUT.`

It works fine when I use a **paragraph node** instead.

I’m using the documentation here to create the payload:  
[https://developer.atlassian.com/cloud/jira/platform/apis/document/nodes/heading/](https://developer.atlassian.com/cloud/jira/platform/apis/document/nodes/heading/)

Does anyone know what I might be doing wrong?

```json
{
  "version": 1,
  "type": "doc",
  "content": [
    {
        "type": "heading",
        "attrs": {
          "level": 1
        },
        "content": [
          {
            "type": "text",
            "text": "Heading 1"
          }
        ]
      }
  ]
}

```

---

<div class="post-metadata">

**Author:** ![anon96974232](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@anon96974232](https://community.developer.atlassian.com/u/anon96974232)\
**Post date:** [November 2, 2025, 8:16pm UTC](https://community.developer.atlassian.com/t/atlassian-cli-using-a-heading-in-atlassian-document-format-to-create-a-comment-returns-an-error/96638/2 "2025-11-02T20:16:13Z")

</div>

Hello @CedrickPlante

Firstly, when you say “Command Line Interface (CLI)”, do you just mean Jira’s REST API?

1. The ADF sample you have provided doesn’t use a **paragraph** node, only a **heading** node, so it’s not clear what you mean by that.
2. There’s no ‘comment’ anywhere in that ADF, so it’s not clear what you mean by that.
3. You’ve tagged your question as related to **Atlassian Development Tools** , but haven’t said which one you’re using or what language, libraries or functions are being using.
4. You haven’t provided a reproducible code sample of the actual request that shows:
  1. which specific API endpoint is being used,
  2. which method is being used,
  3. what authentication type is being used.

Perhaps refer to the [How to ask a good question](https://community.developer.atlassian.com/t/how-to-ask-a-good-question/45777) thread to better understand the minimum level of information that’s expected for someone to be able to assist you.

In the interim, use the [Document builder](https://developer.atlassian.com/cloud/jira/platform/apis/document/playground/) and [Document viewer](https://developer.atlassian.com/cloud/jira/platform/apis/document/viewer/) online tools to test and validate any ADF you create.

PS. If you use the Document viewer tool with the ADF sample you have provided, you will see that the ADF is perfectly valid!

---

<div class="post-metadata">

**Author:** ![CedrickPlante](https://avatars.discourse-cdn.com/v4/letter/c/ecb155/32.png) [@CedrickPlante](https://community.developer.atlassian.com/u/CedrickPlante)\
**Post date:** [November 2, 2025, 8:57pm UTC](https://community.developer.atlassian.com/t/atlassian-cli-using-a-heading-in-atlassian-document-format-to-create-a-comment-returns-an-error/96638/3 "2025-11-02T20:57:32Z")

</div>

@anon96974232 Hi Sunnyape,

Apologies if my previous message was unclear. Here’s some additional context:

I’m developing an agent that leverages the [Atlassian Command Line Interface (CLI)](https://developer.atlassian.com/cloud/acli/guides/introduction/) to retrieve and add comments to Jira work items.

Initially, the agent executes the following command:  
`acli jira workitem view {key} --json --fields "description,summary,comment"`

It then analyzes the associated code to plan the required work.

Finally, the agent adds a comment to the work item outlining the steps necessary to complete the task by running the following command:  
`acli jira workitem comment --key "{key}" --body-file "tmp.json"`

I used an API token with full permissions to authenticate the CLI.

I used the [Atlassian Document Format Playground](https://developer.atlassian.com/cloud/jira/platform/apis/document/playground/) to build the content for `tmp.json`.

When `tmp.json` contains the following:

```auto
{
  "version": 1,
  "type": "doc",
  "content": [
    {
      "type": "paragraph",
      "content": [
        {
          "type": "text",
          "text": "Test"
        }
      ]
    }
  ]
}

```

Everything works correctly — the comment is created.

However, when `tmp.json` contains:

```auto
{
  "version": 1,
  "type": "doc",
  "content": [
    {
      "type": "heading",
      "attrs": {
        "level": 1
      },
      "content": [
        {
          "type": "text",
          "text": "TEST"
        }
      ]
    }
  ]
}

```

The command fails and returns the following error:

```auto
can't be edited: io.atlassian.micros.clibackend.exceptions.InvalidPayloadException: INVALID_INPUT, INVALID_INPUT

```

I hope this explanation provides more clarity.

---

<div class="post-metadata">

**Author:** ![anon96974232](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@anon96974232](https://community.developer.atlassian.com/u/anon96974232)\
**Post date:** [November 3, 2025, 12:12am UTC](https://community.developer.atlassian.com/t/atlassian-cli-using-a-heading-in-atlassian-document-format-to-create-a-comment-returns-an-error/96638/4 "2025-11-03T00:12:30Z")

</div>

Thanks for the detailed explanation, that’s perfect and I understand exactly what you’re referring to.

Firstly, there’s a mistake with the **comment** command as you’ve cited it, as you’ve omitted the _create_ part of the command. The ACLI command would be:

```auto
acli jira workitem comment create --key "{key}" --body-file "tmp.json"

```

Also, there _might be_ a mistake in the documentation for the [Jira Comment Create](https://developer.atlassian.com/cloud/acli/reference/commands/jira-workitem-comment-create/) command, as it says:

> **Options**
> 
> `--body-file` _string_. Plain text file with text or Atlassian Document Format (ADF)

but you might have to specify the comment’s format as ADF using the `--body` option, not the `--body-file` option, the same as for the [Jira Comment Update](https://developer.atlassian.com/cloud/acli/reference/commands/jira-workitem-comment-update/) command. When I use the `--help` flag with _jira workitem comment create_ command, the response matches the documentation and says the body file can be text **OR** ADF, so that’s a longshot that it’s a documentation mistake.

It’s strange that the Jira Comment Update command says:

> **Options**
> 
> `–body-file` _string_. Plain text file containing comment body

so, it says nothing about being able to use an ADF formatted text file when _updating_ a comment. It’s even stranger that, when updating an existing comment using ADF, you have to use a `--body-adf` option to ‘pre-warn’ the command what type of text string is being supplied, whereas that’s not required when creating a new comment.

You may have found a fault with ACLI’s ADF parser for the **heading** node, so have a go at formatting the `tmp.json` file as plain text using wiki markup and see if that works with the `--body-file` option. The plain text wiki markdown for a L1 heading would simply be:

`#Test`

Wiki markdown is often much easier to encode than ADF for simpler text entries.

Lastly, try declaring the wiki text and JSON encoded ADF version of the comment body directly into the _jira workitem comment create_ command as a `--body` string and bypass using the intermediate text file. That might isolate the problem to being the mechanism that parses the file, not the actual ADF itself.

---

<div class="post-metadata">

**Author:** ![Scott3](https://avatars.discourse-cdn.com/v4/letter/s/b3f665/32.png) [@Scott3](https://community.developer.atlassian.com/u/Scott3)\
**Post date:** [November 25, 2025, 4:14am UTC](https://community.developer.atlassian.com/t/atlassian-cli-using-a-heading-in-atlassian-document-format-to-create-a-comment-returns-an-error/96638/5 "2025-11-25T04:14:49Z")

</div>

I have been struggling with this all night using the acli tool. What I have come up with is to create the comment with this for the body “.” and then update the comment with the —body-adf and it keeps all of the formatting.
