KelvinTegelaar / AutotaskAPI

Autotask 2020.2 REST API PowerShell wrapper
https://cyberdrain.com
MIT License
67 stars 25 forks source link

[BUG] Set-AutotaskAPIResource does not work with TicketChecklistItemsChild #43

Closed Serg86 closed 2 years ago

Serg86 commented 2 years ago

Describe the bug Set-AutotaskAPIResource does not work with TicketChecklistItemsChild, perhaps with other resources as well.

To Reproduce Steps to reproduce the behavior: PS :> Set-AutotaskAPIResource -ID $ParentTicketID -Resource TicketChecklistItemsChild -body $ChecklistItemBody

Expected behavior Modifications to the checklist item in the ticket.

Desktop (please complete the following information):

Additional context For debugging purposes I modified the Set-AutotaskAPIResource.ps1 file to output the $ResourceURL and it appears that the parentID is not being applied. I then modified the Invoke-RestMethod line to replace the parentId manually:

Invoke-RestMethod -Uri "$($Script:AutotaskBaseURI)/$($ResourceURL.Replace("{parentId}",$ID))" -headers $Headers -Body $SendingBody -Method Patch

This resulted in successful Api responses and the checklist items were modified correctly.

MysticCodeCruncher commented 2 years ago

I can confirm this is also happening when trying to submit TicketNotesChild resources as well, the parentID is not being applied.

Serg86 commented 2 years ago

I created a new module because this seemed unfinished and abandoned: https://www.powershellgallery.com/packages/AutotaskRestAPI/0.1

KelvinTegelaar commented 2 years ago

Fixed.