Function: addComment()
function addComment(
client,
parameters,
options?
): Promise<{
[key: string]: unknown;
author?: {
[key: string]: unknown;
accountId?: string;
accountType?: string;
active?: boolean;
avatarUrls?: {
[key: string]: unknown;
16x16?: string;
24x24?: string;
32x32?: string;
48x48?: string;
};
displayName?: string;
emailAddress?: string;
self?: string;
timeZone?: string;
};
body?: {
[key: string]: unknown;
content: Record<string, any>[];
type: string & object | "doc";
version: number;
};
created?: Date;
id?: string;
jsdAuthorCanSeeRequest?: boolean;
jsdPublic?: boolean;
properties?: object[];
renderedBody?: string;
self?: string;
updateAuthor?: {
[key: string]: unknown;
accountId?: string;
accountType?: string;
active?: boolean;
avatarUrls?: {
[key: string]: unknown;
16x16?: string;
24x24?: string;
32x32?: string;
48x48?: string;
};
displayName?: string;
emailAddress?: string;
self?: string;
timeZone?: string;
};
updated?: Date;
visibility?: {
[key: string]: unknown;
identifier?: string | null;
type?: "role" | "group" | string & object;
value?: string;
};
}>;Defined in: src/cloud/api/issueComments.ts:97
Adds a comment to an issue.
This operation can be accessed anonymously.
Permissions required:
- Browse projects and Add comments project permission for the project that the issue containing the comment is in.
- If issue-level security is configured, issue-level security permission to view the issue.
Parameters
| Parameter | Type | Description |
|---|---|---|
client | Client | - |
parameters | { author?: { accountId?: string; accountType?: string; active?: boolean; avatarUrls?: { 16x16?: string; 24x24?: string; 32x32?: string; 48x48?: string; }; displayName?: string; emailAddress?: string; self?: string; timeZone?: string; }; body?: | string | { content: Record<string, any>[]; type: string & object | "doc"; version: number; }; created?: unknown; expand?: | string & object | "renderedBody" | (string & object | "renderedBody")[]; id?: string; issueIdOrKey: string; jsdAuthorCanSeeRequest?: boolean; jsdPublic?: boolean; properties?: object[]; renderedBody?: string; self?: string; updateAuthor?: { accountId?: string; accountType?: string; active?: boolean; avatarUrls?: { 16x16?: string; 24x24?: string; 32x32?: string; 48x48?: string; }; displayName?: string; emailAddress?: string; self?: string; timeZone?: string; }; updated?: unknown; visibility?: { identifier?: string | null; type?: "role" | "group" | string & object; value?: string; }; } | - |
parameters.author? | { accountId?: string; accountType?: string; active?: boolean; avatarUrls?: { 16x16?: string; 24x24?: string; 32x32?: string; 48x48?: string; }; displayName?: string; emailAddress?: string; self?: string; timeZone?: string; } | - |
parameters.author.accountId? | string | The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, 5b10ac8d82e05b22cc7d4ef5. |
parameters.author.accountType? | string | The type of account represented by this user. This will be one of 'atlassian' (normal users), 'app' (application user) or 'customer' (Jira Service Desk customer user) |
parameters.author.active? | boolean | Whether the user is active. |
parameters.author.avatarUrls? | { 16x16?: string; 24x24?: string; 32x32?: string; 48x48?: string; } | - |
parameters.author.avatarUrls.16x16? | string | The URL of the item's 16x16 pixel avatar. |
parameters.author.avatarUrls.24x24? | string | The URL of the item's 24x24 pixel avatar. |
parameters.author.avatarUrls.32x32? | string | The URL of the item's 32x32 pixel avatar. |
parameters.author.avatarUrls.48x48? | string | The URL of the item's 48x48 pixel avatar. |
parameters.author.displayName? | string | The display name of the user. Depending on the user’s privacy settings, this may return an alternative value. |
parameters.author.emailAddress? | string | The email address of the user. Depending on the user’s privacy settings, this may be returned as null. |
parameters.author.self? | string | The URL of the user. |
parameters.author.timeZone? | string | The time zone specified in the user's profile. Depending on the user’s privacy settings, this may be returned as null. |
parameters.body? | | string | { content: Record<string, any>[]; type: string & object | "doc"; version: number; } | A document in Atlassian Document Format, or a string of wiki markup — a string is sent to the v2 endpoint that parses it, and the result is read back as a document. |
parameters.created? | unknown | The date and time at which the comment was created. |
parameters.expand? | | string & object | "renderedBody" | (string & object | "renderedBody")[] | Use expand to include additional information about comments in the response. This parameter accepts renderedBody, which returns the comment body rendered in HTML. |
parameters.id? | string | The ID of the comment. |
parameters.issueIdOrKey? | string | The ID or key of the issue. |
parameters.jsdAuthorCanSeeRequest? | boolean | Whether 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 issuesfor information on setting up this feature. |
parameters.jsdPublic? | boolean | Whether 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 operation. |
parameters.properties? | object[] | A list of comment properties. Optional on create and update. |
parameters.renderedBody? | string | The rendered version of the comment. |
parameters.self? | string | The URL of the comment. |
parameters.updateAuthor? | { accountId?: string; accountType?: string; active?: boolean; avatarUrls?: { 16x16?: string; 24x24?: string; 32x32?: string; 48x48?: string; }; displayName?: string; emailAddress?: string; self?: string; timeZone?: string; } | - |
parameters.updateAuthor.accountId? | string | The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, 5b10ac8d82e05b22cc7d4ef5. |
parameters.updateAuthor.accountType? | string | The type of account represented by this user. This will be one of 'atlassian' (normal users), 'app' (application user) or 'customer' (Jira Service Desk customer user) |
parameters.updateAuthor.active? | boolean | Whether the user is active. |
parameters.updateAuthor.avatarUrls? | { 16x16?: string; 24x24?: string; 32x32?: string; 48x48?: string; } | - |
parameters.updateAuthor.avatarUrls.16x16? | string | The URL of the item's 16x16 pixel avatar. |
parameters.updateAuthor.avatarUrls.24x24? | string | The URL of the item's 24x24 pixel avatar. |
parameters.updateAuthor.avatarUrls.32x32? | string | The URL of the item's 32x32 pixel avatar. |
parameters.updateAuthor.avatarUrls.48x48? | string | The URL of the item's 48x48 pixel avatar. |
parameters.updateAuthor.displayName? | string | The display name of the user. Depending on the user’s privacy settings, this may return an alternative value. |
parameters.updateAuthor.emailAddress? | string | The email address of the user. Depending on the user’s privacy settings, this may be returned as null. |
parameters.updateAuthor.self? | string | The URL of the user. |
parameters.updateAuthor.timeZone? | string | The time zone specified in the user's profile. Depending on the user’s privacy settings, this may be returned as null. |
parameters.updated? | unknown | The date and time at which the comment was updated last. |
parameters.visibility? | { identifier?: string | null; type?: "role" | "group" | string & object; value?: string; } | - |
parameters.visibility.identifier? | string | null | The ID of the group or the name of the role that visibility of this item is restricted to. |
parameters.visibility.type? | "role" | "group" | string & object | Whether visibility of this item is restricted to a group or role. |
parameters.visibility.value? | string | The 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. |
options? | RequestOptions | - |
Returns
Promise<{ [key: string]: unknown; author?: { [key: string]: unknown; accountId?: string; accountType?: string; active?: boolean; avatarUrls?: { [key: string]: unknown; 16x16?: string; 24x24?: string; 32x32?: string; 48x48?: string; }; displayName?: string; emailAddress?: string; self?: string; timeZone?: string; }; body?: { [key: string]: unknown; content: Record<string, any>[]; type: string & object | "doc"; version: number; }; created?: Date; id?: string; jsdAuthorCanSeeRequest?: boolean; jsdPublic?: boolean; properties?: object[]; renderedBody?: string; self?: string; updateAuthor?: { [key: string]: unknown; accountId?: string; accountType?: string; active?: boolean; avatarUrls?: { [key: string]: unknown; 16x16?: string; 24x24?: string; 32x32?: string; 48x48?: string; }; displayName?: string; emailAddress?: string; self?: string; timeZone?: string; }; updated?: Date; visibility?: { [key: string]: unknown; identifier?: string | null; type?: "role" | "group" | string & object; value?: string; }; }>