Jira.js - Jira Cloud API library
    Preparing search index...

    Interface Attachment

    Represents an attachment to be added to an issue.

      const attachment: Attachment = {
    filename: 'example.txt',
    file: Buffer.from('Hello, world!'),
    mimeType: 'text/plain',
    };
    interface Attachment {
        file:
            | string
            | Buffer<ArrayBufferLike>
            | ReadableStream<any>
            | Readable
            | Blob
            | File;
        filename: string;
        mimeType?: string;
    }
    Index

    Properties

    file:
        | string
        | Buffer<ArrayBufferLike>
        | ReadableStream<any>
        | Readable
        | Blob
        | File

    The content of the attachment. Can be one of the following:

    • Buffer: For binary data.
    • ReadableStream: For streaming large files.
    • string: For text-based content.
    • Blob: For browser-like blob objects.
    • File: For file objects with metadata (e.g., in web environments).
      const fileContent = fs.readFileSync('./document.pdf');
    
    filename: string

    The name of the attachment file.

      const filename = 'document.pdf';
    
    mimeType?: string

    Optional MIME type of the attachment. Example values include:

    • 'application/pdf'
    • 'image/png'

    If not provided, the MIME type will be automatically detected based on the filename.

      const mimeType = 'application/pdf';