Cannot close tasks using API anymore

Cannot close tasks using API anymore

We are using some powershell scripts to automate requests in SDP. Some of those scripts need to close tasks in tickets. We updated SDP to version 11.1 Build 11105 and since then it isn't possible to update tasks anymore. Something has changed and i don't know wat. 

The function i use :

  1. Function Close_Task {
  2. <#
  3. .SYNOPSIS


  4. .DESCRIPTION
  5. Long description

  6. .PARAMETER Status
  7. Used to send along the status of the task

  8. .PARAMETER Taskid

  9. .EXAMPLE
  10. Close_Task -Status "Closed" -taskid 3423
  11. #>
  12.     [CmdletBinding()]
  13.     param(
  14.         [Parameter(Mandatory = $true)] [String] $Status,
  15.         [Parameter(Mandatory = $true)] [String] $taskid
  16.     )


  17. $TaskUrl = $sdphost + "/api/v3/tasks/$taskId"
  18. $taskJson = @"
  19. {
  20.     "task": {
  21.         "status": {
  22.         "name": "$Status"
  23.         }
  24.     }
  25. }
  26. "@
  27.     $taskHeader = @{TECHNICIAN_KEY = $techkey }
  28.     $taskBody = @{INPUT_DATA = $taskJson }
  29.     Invoke-RestMethod -Method PUT -Uri $TaskUrl -Header $taskHeader -Body $taskBody -ContentType "application/x-www-form-urlencoded" -UseBasicParsing
  30. }   
Then i use for example the following command :
  1. Close_Task -TaskID 9645 -Status "Closed"

Normally this would give the task with id 9645 the status Closed but now i get the following error message : 

  1. Invoke-RestMethod : {"response_status":{"status_code":4000,"messages":[{"status_code":4001,"field":"input_data","type":"failed","message":"Value not provided"}],"status":"failed"}}
Anyone has any idea what is going wrong and what has changed?

                  New to ADSelfService Plus?