Skip to content

v4.0.4

Closed Jan 4, 2025 100% complete
  • #320: Resolved a tree-shaking issue where importing a single client would still include all clients in the output bundle when using bundlers. Now, only the required client code is included. Thanks to Nao Yonashiro for reporting the issue and proposing a fix.

  • #327: Replaced the form-data library with formdata-node to enable compatibility with ESM proje…

  • #320: Resolved a tree-shaking issue where importing a single client would still include all clients in the output bundle when using bundlers. Now, only the required client code is included. Thanks to Nao Yonashiro for reporting the issue and proposing a fix.

  • #327: Replaced the form-data library with formdata-node to enable compatibility with ESM projects when adding attachments via the issueAttachment.addAttachment method. Thanks to Paweł Król for reporting the issue and Matyáš Kroupa for implementing the fix.

  • Improvement: The type of the projectIdOrKey property was updated from string to number | string for project update operations. This enhancement improves type safety and flexibility when handling project identifiers.

  • Enhancement: Added a mimeType property to the version2.issueAttachments.addAttachment, version3.issueAttachments.addAttachment, and serviceDesk.serviceDesk.attachTemporaryFile methods. This allows specifying the file type. If mimeType is not provided, a default type is inferred from the filename.

    Examples:

    👎 Before:

    const client = new Version2Client() || new Version3Client() || new ServiceDeskClient();
    
    const attachment = await client.issueAttachments.addAttachment({
        issueIdOrKey: issue.key,
        attachment: {
            filename: 'issueAttachments.test.ts',
            file: fs.readFileSync('./tests/integration/version2/issueAttachments.test.ts'),
        },
    });
    
    console.log(attachment[0].mimeType); // Will be 'video/mp2t'

    👍 Now:

    const client = new Version2Client() || new Version3Client() || new ServiceDeskClient();
    
    const attachment = await client.issueAttachments.addAttachment({
        issueIdOrKey: issue.key,
        attachment: {
            filename: 'issueAttachments.test.ts',
            file: fs.readFileSync('./tests/integration/version2/issueAttachments.test.ts'),
            mimeType: 'application/typescript',
        },
    });
    
    console.log(attachment[0].mimeType); // Will be 'application/typescript'

This milestone is closed.

No open issues remain. View closed issues or see open milestones in this repository.