New-FreshserviceContract will create a Contract with specified attachment(s).
Current Behavior
Error message from API:
| {"description":"Validation failed","errors":[{"field":"auto_renew","message":"It should be of type
| Boolean","code":"datatype_mismatch"},{"field":"notify_expiry","message":"It should be of type
| Boolean","code":"datatype_mismatch"},{"field":"notify_to","message":"It should be in the 'valid email
| address' format","code":"invalid_value","nested_field":"notify_to.[0]"}]}
Appears to be an issue with data being passed as multipart/form-data.
Possible Solution
As a workaround, create Contract without attachment(s) and then use Set-FreshServiceContract to attach items.
Steps to Reproduce (for bugs)
Create a new Contract and specify the path to a file with -attachments:
| {"description":"Validation failed","errors":[{"field":"auto_renew","message":"It should be of type
| Boolean","code":"datatype_mismatch"},{"field":"notify_expiry","message":"It should be of type
| Boolean","code":"datatype_mismatch"},{"field":"notify_to","message":"It should be in the 'valid email
| address' format","code":"invalid_value","nested_field":"notify_to.[0]"}]}
If the attachment is removed, the code executes successfully.
## 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 Contract with attachments.
## Your Environment
<!--- Include as many relevant details about the environment you experienced the bug in -->
* Module version used: 0.1.4
* Operating System and PowerShell version: Windows 11 with Powershell 7.3.4
Expected Behavior
New-FreshserviceContract will create a Contract with specified attachment(s).
Current Behavior
Error message from API:
Appears to be an issue with data being passed as multipart/form-data.
Possible Solution
As a workaround, create Contract without attachment(s) and then use Set-FreshServiceContract to attach items.
Steps to Reproduce (for bugs)
$contractParams = @{
id = 6
}
New-FreshserviceContract @contractParams -Verbose
| {"description":"Validation failed","errors":[{"field":"auto_renew","message":"It should be of type | Boolean","code":"datatype_mismatch"},{"field":"notify_expiry","message":"It should be of type | Boolean","code":"datatype_mismatch"},{"field":"notify_to","message":"It should be in the 'valid email | address' format","code":"invalid_value","nested_field":"notify_to.[0]"}]}