You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 moduleif(Get-InstalledModule'ConnectWiseManageAPI'-ErrorAction SilentlyContinue){ Update-Module'ConnectWiseManageAPI'-Verbose }
else{ Install-Module'ConnectWiseManageAPI'-Verbose }
Import-Module'ConnectWiseManageAPI'# Connect to your Manage serverConnect-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 tablescompany=@{"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-CWM
The text was updated successfully, but these errors were encountered:
Long time since you posted this, but in case it helps others, you need to pass the project through as a hash table too. That will fix this particular experience but it will still show up as a service ticket.
$newticket = new-cwmticket @NewTicketParameters -project @{id=$project}
Or you can add this to your NewTicketParameters splat
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:
The text was updated successfully, but these errors were encountered: