Summary
acli jira workitem comment create does not support the --body-adf flag, even though acli jira workitem comment update does. This means there's no way to create a comment with rich ADF formatting in a single command.
The --body flag's help text says it accepts "plain text or Atlassian Document Format (ADF)", but passing raw ADF JSON results in it being wrapped as a plain text paragraph via adf.FromText(), not parsed as ADF.
Steps to Reproduce
# Create an ADF JSON file
cat > /tmp/test.json << 'ENDJSON'
{
"version": 1,
"type": "doc",
"content": [
{
"type": "heading",
"attrs": { "level": 2 },
"content": [{ "type": "text", "text": "Hello" }]
}
]
}
ENDJSON
# This fails with INVALID_INPUT:
acli jira workitem comment create --key TEST-123 --body-adf /tmp/test.json
# This also doesn't work — ADF JSON is posted as plain text:
acli jira workitem comment create --key TEST-123 --body '{"version":1,"type":"doc","content":[...]}'
# But update works fine:
acli jira workitem comment update --key TEST-123 --id 12345 --body-adf /tmp/test.json
Expected Behavior
acli jira workitem comment create should support --body-adf <file> the same way comment update does.
Workaround
Create a stub comment, then immediately update it with ADF:
acli jira workitem comment create --key TEST-123 --body "placeholder" --json
# extract comment ID from output
acli jira workitem comment update --key TEST-123 --id <ID> --body-adf /path/to/adf.json
Root Cause (from binary analysis, v1.3.13-stable)
The two commands use different architectures internally:
-
comment create is a hardcoded Go command (create_comment.go) that only registers --body and --body-file cobra flags. When --body receives input, it unconditionally calls adf.FromText() which wraps everything as a plain text paragraph — even valid ADF JSON.
-
comment update is a YAML-templated dynamic command (jira/workitem/comment_update.yaml) that defines three mutually exclusive flags: body, body-file, and body-adf (type flag.BodyAdf). The body-adf flag properly reads and parses ADF JSON via adf.FromJSON().
Relevant functions in the binary:
adf.FromText() — wraps as plain text paragraph (what comment create uses)
adf.FromJSON() — parses ADF JSON (what comment update --body-adf uses)
adf.FromData() — auto-detects format (not used by either command)
The fix would be to either:
- Add
--body-adf flag to the comment create Go command, or
- Migrate
comment create to the YAML-templated system (which already has the infrastructure for --body-adf)
Environment
- acli version: 1.3.13-stable
- OS: macOS (Apple Silicon, Homebrew install)
- Jira Cloud
Summary
acli jira workitem comment createdoes not support the--body-adfflag, even thoughacli jira workitem comment updatedoes. This means there's no way to create a comment with rich ADF formatting in a single command.The
--bodyflag's help text says it accepts "plain text or Atlassian Document Format (ADF)", but passing raw ADF JSON results in it being wrapped as a plain text paragraph viaadf.FromText(), not parsed as ADF.Steps to Reproduce
Expected Behavior
acli jira workitem comment createshould support--body-adf <file>the same waycomment updatedoes.Workaround
Create a stub comment, then immediately update it with ADF:
Root Cause (from binary analysis, v1.3.13-stable)
The two commands use different architectures internally:
comment createis a hardcoded Go command (create_comment.go) that only registers--bodyand--body-filecobra flags. When--bodyreceives input, it unconditionally callsadf.FromText()which wraps everything as a plain text paragraph — even valid ADF JSON.comment updateis a YAML-templated dynamic command (jira/workitem/comment_update.yaml) that defines three mutually exclusive flags:body,body-file, andbody-adf(typeflag.BodyAdf). Thebody-adfflag properly reads and parses ADF JSON viaadf.FromJSON().Relevant functions in the binary:
adf.FromText()— wraps as plain text paragraph (whatcomment createuses)adf.FromJSON()— parses ADF JSON (whatcomment update --body-adfuses)adf.FromData()— auto-detects format (not used by either command)The fix would be to either:
--body-adfflag to thecomment createGo command, orcomment createto the YAML-templated system (which already has the infrastructure for--body-adf)Environment