-
Notifications
You must be signed in to change notification settings - Fork 72
Open
Description
Trying to add a project ticket via PowerShell, when I use the -project with New-CWMTicket I get "New-CWMTicket : Cannot process argument transformation on parameter 'project'. Cannot convert the "386" value of type "System.Int32" to type "System.Collections.Hashtable".
Any assistance would be greatly appreciated!
Here is my code:
$CWMConnectionInfo = @{
Server = 'na.myconnectwise.net'
Company = 'BLANK'
pubkey = 'BLANK'
privatekey = 'BLANK'
clientid = 'BLANK'
}
# Install/Update/Load the module
if(Get-InstalledModule 'ConnectWiseManageAPI' -ErrorAction SilentlyContinue){ Update-Module 'ConnectWiseManageAPI' -Verbose }
else{ Install-Module 'ConnectWiseManageAPI' -Verbose }
Import-Module 'ConnectWiseManageAPI'
# Connect to your Manage server
Connect-CWM @CWMConnectionInfo -Force -Verbose
# Choose a company to make test a ticket for
#$Companies = Get-CWMCompany -all
#$Company = $Companies | Select-Object ID, Name | Out-GridView -OutputMode Single -Title 'Select Company'
$Company = '457'
$Project = '386'
$NewTicketParameters = @{
summary = 'Install N-Central Agent on FWGLEX31LPTP'
# We want to pass Manage objects as hash tables
company = @{"identifier" = "$Company"}
contactName = 'BLANK'
contactPhoneNumber = 'BLANK'
contactEmailAddress = 'BLANK'
}
$NewTicket = New-CWMTicket @NewTicketParameters -project $Project
# To clear your connection information from memory you can terminate the session or issue the disconnect command.
Disconnect-CWMMetadata
Metadata
Assignees
Labels
No labels