Created
October 26, 2021 11:45
-
-
Save rkaldung/410b55f4a45f9b555ce75d022aa62407 to your computer and use it in GitHub Desktop.
Revisions
-
rkaldung created this gist
Oct 26, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ $user = "John.Doe" $pass = "VerySecret" $uri = "https://FQDNotrs/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST" $headers = @{} $headers.Add("Accept", "application/json") $headers.Add("Content-Type", "application/json") # Parameter see https://github.com/znuny/Znuny/blob/dev/Kernel/GenericInterface/Operation/Ticket/TicketUpdate.pm#L68 $UpdateData = @{ UserLogin = $user Password = $pass Ticket = @( Queue = "Datacenter::2nd Level" ) DynamicField = @( @{ Name = "Field1" Value = "Value1" }, @{ Name = "Field2" Value = "Value2" } ) } $json = $UpdateData | ConvertTo-Json $Result = Invoke-RestMethod -Method PATCH -Headers $Headers -ContentType 'application/json' -Uri "$uri/Ticket/1" -Body $json Write-Host Update ticket $Result.TicketNumber