sgtoj / PSConnectWise

PowerShell Module that provide several CmdLets to interact with ConnectWise REST API service.
MIT License
45 stars 13 forks source link

Update-CWServiceTicket unable to Update #47

Open Cy3lic opened 6 years ago

Cy3lic commented 6 years ago

Hi Brian

Thank you for an excellent module.

I have found some issues in regards to some of the functions that should be easy fixes.

  1. When calling a function the parameter -Server $CWServer is not referenced and needs to be changed to -Session $CWServerto work.

I have tried a couple of the functions with success but i am having issues with the one i really need.

Update-CWServiceTicket

When i call the function: Update-CWServiceTicket -ID 751047 -StatusID 761 -Message "Changed Status" -Session $CWServer; The ID is confirmed and exists in CW as new and i am trying to set Status to Completed.

This is the error that i get:

Update-CWServiceTicket : Parameter set cannot be resolved using the specified named parameters.
At line:40 char:2
+  Update-CWServiceTicket -ID 751047 -StatusID 761 -Message "Changed St ...
+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Update-CWServiceTicket], ParameterBindingException
    + FullyQualifiedErrorId : AmbiguousParameterSet,Update-CWServiceTicket

According to the synopsis the the supplied parameters are the only ones that are Mandatory. I might be doing something wrong?

Thanks.

TheSystech commented 6 years ago

I could be wrong, as I haven't fully tested but from reviewing the module itself, it would appear that when you are going to specify the -Message option you also have to specify the TypeID. Even if you aren't changing the type. I'm basing that off of the parameter set setup in the code. I can tell that it does work for me in my code, but I specifically am updating the TypeID with what I'm doing, as I'm also moving the board, and setting which option to put the Message in.