Skip to content

Function: getComment() ​

ts
function getComment(
   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:158

Returns a comment.

This operation can be accessed anonymously.

Permissions required:

  • Browse projects project permission for the project containing the comment.
  • If issue-level security is configured, issue-level security permission to view the issue.
  • If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted to.

Parameters ​

ParameterTypeDescription
clientClient-
parameters{ expand?: | string & object | "renderedBody" | (string & object | "renderedBody")[]; id: string; issueIdOrKey: string; }-
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?stringThe ID of the comment.
parameters.issueIdOrKey?stringThe ID or key of the issue.
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; }; }>