Open LedgerLand opened 1 year ago
I can confirm and reproduce this bug using the Contracts
entity:
$Data = Get-AutotaskAPIResource -Resource Contracts -SearchQuery $filter
$Body = New-AutotaskBody -Resource Contracts
New-AutotaskBody: Getting object failed: Response status code does not indicate success: 404 (Not Found).
After re-authenticating using Add-AutotaskAPIAuth
:
$Body = New-AutotaskBody -Resource Contracts
There must be something in Get-AutotaskAPIResource
that's breaking a script variable or something.
I have run into what I believe is a bug when trying to create a new resource object. In my specific case, these are the commands to reproduce the issue:
These steps produce the following error:
I am writing using Visual Studio Code on a Windows 11 Pro workstation. Below is the PowerShell version table:
If I re-run the command "Add-AutotaskAPIAuth -ApiIntegrationcode $ATTrackingApi -credentials $ATCredentials -VerboseAdd-AutotaskAPIAuth -ApiIntegrationcode $ATTrackingApi -credentials $ATCredentials" after the Get request the issue does not happen.
Equally, if you try and create a different resource to the one queried (ie. query tickets but create a company) then this does not happen.
If you need anymore details just let me know :-)