New-CWMTicket fails when providing the company ID. To get around it I had to run the Invoke-RestMethod for the ticket to be created. Here is the error below:
PS C:> New-CWMTicket
cmdlet New-CWMTicket at command pipeline position 1
Supply values for the following parameters:
summary: testing
company: 250
Invoke-CWMWebRequest : An error has been thrown.
at Invoke-CWMWebRequest, : line 745
at Invoke-CWMNewMaster, : line 630
at New-CWMTicket, : line 3367
at , : line 1
--> ConnectWiseApi
--> Error converting value "250" to type 'ConnectWise.Apis.v3_0.v2015_3.Common.Models.CompanyReference'. Path
'company', line 3, position 21.
At line:630 char:15
-
$Result = Invoke-CWMWebRequest -Arguments $WebRequestArguments
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
- FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-CWMWebRequest
New-CWMTicket fails when providing the company ID. To get around it I had to run the Invoke-RestMethod for the ticket to be created. Here is the error below:
PS C:> New-CWMTicket
cmdlet New-CWMTicket at command pipeline position 1
Supply values for the following parameters:
summary: testing
company: 250
Invoke-CWMWebRequest : An error has been thrown.
at Invoke-CWMWebRequest, : line 745
at Invoke-CWMNewMaster, : line 630
at New-CWMTicket, : line 3367
at , : line 1
--> ConnectWiseApi
--> Error converting value "250" to type 'ConnectWise.Apis.v3_0.v2015_3.Common.Models.CompanyReference'. Path
'company', line 3, position 21.
At line:630 char:15