Skip to content

Atlassian: Add comment

Atlassian issueComments.addComment: arguments, response, policy and SDK examples.

← Issue comments operations · Get started

Operation atlassian.addcomment

Provider route: POST /{cloudId}/rest/api/3/issue/{issueIdOrKey}/comment. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/atlassian with npm, or alter-sdk-atlassian with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { AtlassianIntegration } from "@alter-ai/atlassian";
async function execute(input: Parameters<AtlassianIntegration["issueComments"]["addComment"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new AtlassianIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.issueComments.addComment(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_atlassian import AtlassianIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = AtlassianIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.issue_comments.add_comment(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.cloudIdstringRequired within parentPattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
path.issueIdOrKeystringRequired within parent
queryobjectOptionalAdditional keys: not allowed
query.expandstringOptional
bodyModelRequired within parentExpand Add comment — request body — body

Referenced models: Add comment — request body — body

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Add comment — response body

Referenced models: Add comment — response body

4 more schemas are linked from the tables above, on the schema pages.

Add comment — request body — body
FieldTypePresenceDescription and constraints
$objectRootA comment.
Additional keys: allowed
authorModelOptionalExpand Add comment — request body — body author
The ID of the user who created the comment.
Read only: true
bodyJSONOptionalThe comment text in [Atlassian Document Format](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/).
createdstringOptionalThe date and time at which the comment was created.
Format: date-time
Read only: true
idstringOptionalThe ID of the comment.
Read only: true
jsdAuthorCanSeeRequestbooleanOptionalWhether the comment was added from an email sent by a person who is not part of the issue. See [Allow external emails to be added as comments on issues](https://support.atlassian.com/jira-service-management-cloud/docs/allow-external-emails-to-be-added-as-comments-on-issues/)for information on setting up this feature.
Read only: true
jsdPublicbooleanOptionalWhether the comment is visible in Jira Service Desk. Defaults to true when comments are created in the Jira Cloud Platform. This includes when the site doesn't use Jira Service Desk or the project isn't a Jira Service Desk project and, therefore, there is no Jira Service Desk for the issue to be visible on. To create a comment with its visibility in Jira Service Desk set to false, use the Jira Service Desk REST API [Create request comment](https://developer.atlassian.com/cloud/jira/service-desk/rest/#api-rest-servicedeskapi-request-issueIdOrKey-comment-post) operation.
Read only: true
propertiesarrayOptionalA list of comment properties. Optional on create and update.
properties[]ModelEach itemExpand Edit issue — request body — body properties item
renderedBodystringOptionalThe rendered version of the comment.
Read only: true
selfstringOptionalThe URL of the comment.
Read only: true
updateAuthorModelOptionalExpand Add comment — request body — body author
The ID of the user who updated the comment last.
Read only: true
updatedstringOptionalThe date and time at which the comment was updated last.
Format: date-time
Read only: true
visibilityModelOptionalExpand Add comment — request body — body visibility
The group or role to which this comment is visible. Optional on create and update.

Referenced models: Edit issue — request body — body properties item, Add comment — request body — body author, Add comment — request body — body visibility

Add comment — response body
FieldTypePresenceDescription and constraints
$objectRootA comment.
Additional keys: allowed
authorJSONOptional
author (anyOf 1)ModelAlternativeExpand Add comment — response body — author account Id, account Type, active, avatar Urls, display Name, email Address, key, name, self, time Zone
The ID of the user who created the comment.
Read only: true
author (anyOf 2)nullAlternative
bodyJSONOptional
body (anyOf 1)JSONAlternativeThe comment text in [Atlassian Document Format](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/).
body (anyOf 2)nullAlternative
createdJSONOptional
created (anyOf 1)JSONAlternative
created (anyOf 1) (anyOf 1)stringAlternativeThe date and time at which the comment was created.
Read only: true
created (anyOf 1) (anyOf 2)integerAlternative
created (anyOf 2)nullAlternative
idJSONOptional
id (anyOf 1)stringAlternativeThe ID of the comment.
Read only: true
id (anyOf 2)nullAlternative
jsdAuthorCanSeeRequestJSONOptional
jsdAuthorCanSeeRequest (anyOf 1)booleanAlternativeWhether the comment was added from an email sent by a person who is not part of the issue. See [Allow external emails to be added as comments on issues](https://support.atlassian.com/jira-service-management-cloud/docs/allow-external-emails-to-be-added-as-comments-on-issues/)for information on setting up this feature.
Read only: true
jsdAuthorCanSeeRequest (anyOf 2)nullAlternative
jsdPublicJSONOptional
jsdPublic (anyOf 1)booleanAlternativeWhether the comment is visible in Jira Service Desk. Defaults to true when comments are created in the Jira Cloud Platform. This includes when the site doesn't use Jira Service Desk or the project isn't a Jira Service Desk project and, therefore, there is no Jira Service Desk for the issue to be visible on. To create a comment with its visibility in Jira Service Desk set to false, use the Jira Service Desk REST API [Create request comment](https://developer.atlassian.com/cloud/jira/service-desk/rest/#api-rest-servicedeskapi-request-issueIdOrKey-comment-post) operation.
Read only: true
jsdPublic (anyOf 2)nullAlternative
propertiesJSONOptional
properties (anyOf 1)arrayAlternativeA list of comment properties. Optional on create and update.
properties (anyOf 1)[]ModelEach itemExpand Get user property — response body
properties (anyOf 2)nullAlternative
renderedBodyJSONOptional
renderedBody (anyOf 1)stringAlternativeThe rendered version of the comment.
Read only: true
renderedBody (anyOf 2)nullAlternative
selfJSONOptional
self (anyOf 1)stringAlternativeThe URL of the comment.
Read only: true
self (anyOf 2)nullAlternative
updateAuthorJSONOptional
updateAuthor (anyOf 1)ModelAlternativeExpand Add comment — response body — author account Id, account Type, active, avatar Urls, display Name, email Address, key, name, self, time Zone
The ID of the user who updated the comment last.
Read only: true
updateAuthor (anyOf 2)nullAlternative
updatedJSONOptional
updated (anyOf 1)JSONAlternative
updated (anyOf 1) (anyOf 1)stringAlternativeThe date and time at which the comment was updated last.
Read only: true
updated (anyOf 1) (anyOf 2)integerAlternative
updated (anyOf 2)nullAlternative
visibilityJSONOptional
visibility (anyOf 1)ModelAlternativeExpand Add comment — response body — visibility The group or role to which this item is visible
The group or role to which this comment is visible. Optional on create and update.
visibility (anyOf 2)nullAlternative

Referenced models: Get user property — response body, Add comment — response body — author account Id, account Type, active, avatar Urls, display Name, email Address, key, name, self, time Zone, Add comment — response body — visibility The group or role to which this item is visible

Edit issue — request body — body properties item
FieldTypePresenceDescription and constraints
$objectRootAn entity property, for more information see [Entity properties](https://developer.atlassian.com/cloud/jira/platform/jira-entity-properties/).
Additional keys: not allowed
keystringOptionalThe key of the property. Required on create and update.
valueJSONOptionalThe value of the property. Required on create and update.
Add comment — request body — body visibility
FieldTypePresenceDescription and constraints
$objectRootThe group or role to which this item is visible.
Additional keys: allowed
identifierJSONOptional
identifier (anyOf 1)stringAlternativeThe ID of the group or the name of the role that visibility of this item is restricted to.
identifier (anyOf 2)nullAlternative
typestringOptionalWhether visibility of this item is restricted to a group or role.
One of: group, role
valuestringOptionalThe name of the group or role that visibility of this item is restricted to. Please note that the name of a group is mutable, to reliably identify a group use `identifier`.
Get user property — response body
FieldTypePresenceDescription and constraints
$objectRootAn entity property, for more information see [Entity properties](https://developer.atlassian.com/cloud/jira/platform/jira-entity-properties/).
keyJSONOptional
key (anyOf 1)stringAlternativeThe key of the property. Required on create and update.
key (anyOf 2)nullAlternative
valueJSONOptional
value (anyOf 1)JSONAlternativeThe value of the property. Required on create and update.
value (anyOf 2)nullAlternative
Assign issue — request body — body avatar Urls
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
16x16stringOptionalThe URL of the item's 16x16 pixel avatar.
Format: uri
24x24stringOptionalThe URL of the item's 24x24 pixel avatar.
Format: uri
32x32stringOptionalThe URL of the item's 32x32 pixel avatar.
Format: uri
48x48stringOptionalThe URL of the item's 48x48 pixel avatar.
Format: uri

SDK function policy ID: atlassian.addcomment. Catalog operation: addComment. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Required provider scopes: ["write:jira-work"]

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.