Skip to content

Function: createAttachment() ​

ts
function createAttachment(
   client, 
   parameters, 
   options?
): Promise<{
[key: string]: unknown;
  attachments?: object[];
  comment?: {
   [key: string]: unknown;
     _links?: {
      [key: string]: unknown;
        self?: string;
     };
     author?: {
      [key: string]: unknown;
        _links?: {
         [key: string]: unknown;
           avatarUrls?: Record<string, any>;
           jiraRest?: string;
           self?: string;
        };
        active?: boolean;
        displayName?: string;
        emailAddress?: string;
        key?: string;
        name?: string;
        timeZone?: string;
     };
     body?: string;
     created?: {
      [key: string]: unknown;
        epochMillis?: number;
        friendly?: string;
        iso8601?: string;
        jira?: string;
     };
     id?: string;
     public?: boolean;
  };
}>;

Defined in: src/serviceDeskServer/api/requestAttachments.ts:22

Adds one or more temporary attachments that were created using Attach temporary file to a customer request.

The attachment visibility is set by the public field.

Setting attachment visibility is dependent on the user's permission. For example, Agents can create either public or internal attachments, while Unlicensed users can only create internal attachments, and Customers can only create public attachments.

An additional comment may be provided which will be prepended to the attachments.

Parameters ​

ParameterTypeDescription
clientClient-
parameters{ additionalComment?: { body?: string; }; issueIdOrKey: string; public?: boolean; temporaryAttachmentIds?: string[]; }-
parameters.additionalComment?{ body?: string; }-
parameters.additionalComment.body?string-
parameters.issueIdOrKey?stringThe id or key of the customer request.
parameters.public?boolean-
parameters.temporaryAttachmentIds?string[]-
options?RequestOptions-

Returns ​

Promise<{ [key: string]: unknown; attachments?: object[]; comment?: { [key: string]: unknown; _links?: { [key: string]: unknown; self?: string; }; author?: { [key: string]: unknown; _links?: { [key: string]: unknown; avatarUrls?: Record<string, any>; jiraRest?: string; self?: string; }; active?: boolean; displayName?: string; emailAddress?: string; key?: string; name?: string; timeZone?: string; }; body?: string; created?: { [key: string]: unknown; epochMillis?: number; friendly?: string; iso8601?: string; jira?: string; }; id?: string; public?: boolean; }; }>