flycastpartnersinc / FreshservicePS

Powershell Module to interface with Freshworks Freshservice REST API.
MIT License
23 stars 5 forks source link

New-FreshServiceRelease attachments not working #2

Open rasimmers opened 1 year ago

rasimmers commented 1 year ago

Expected Behavior

New-FreshserviceRelease will create a Release with specified attachment(s).

Current Behavior

Error message from API: We're sorry, but something went wrong.

Possible Solution

As a workaround, create Release without attachment(s) and then use Set-FreshServiceRelease to attach items.

Steps to Reproduce (for bugs)

  1. Create a new Release and specify the path to a file with -attachments:
    
    $newFreshServiceReleaseSplat = @{
    subject            = "Software Z-1000 v1.0"
    priority           = 1
    status             = 1
    planned_start_date = (Get-Date  -Hour 19 -Minute 0 -Second 0).ToUniversalTime()
    planned_end_date   = (Get-Date  -Hour 19 -Minute 15 -Second 0).ToUniversalTime()
    release_type       = 2
    attachments = 'C:\Scripts\Attachments\attachment.txt'
    }

New-FreshServiceRelease @newFreshServiceReleaseSplat


2. Execute command and API produces: _We're sorry, but something went wrong._

## Context
<!--- How has this issue affected you? What are you trying to accomplish? -->
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
Cannot create Freshservice Release with attachments.
## Your Environment
<!--- Include as many relevant details about the environment you experienced the bug in -->
* Module version used: 0.1.1
* Operating System and PowerShell version: Windows 11 with Powershell 7.3.4
rasimmers commented 1 year ago

This issue has been raised with Freshservice Product Management. Based on initial findings and behavior, it needs to be investigated as a bug in the Freshservice API. Attachments are supported with Invoke-WebRequest -Form and the same code is used in all API endpoints.