is it possible to use the TicketSearch function to query all open tickets and to display the ticket numbers?
I get no error and no result. My user has all rights to all queues.
Ive tried the following:
Result: "HASH" should show the ticket number. *https://doc.otrs.com/doc/api/otrs/8.0/P ... ch.pm.html
Webservice Configuration: /TicketSearch, POST, HTTP::REST
Code: Select all
$uri = "https://otrs-test.de/otrs/nph-genericinterface.pl/Webservice/WebTest/TicketSearch"
$user = 'TEST'
$pass = 'TEST'
$pair = "$($user):$($pass)"
$encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair))
$basicAuthValue = "Basic $encodedCreds"
$headers = @{
Authorization = $basicAuthValue
}
$TicketData = @{
UserLogin = "test"
Password = "testnutzer"
Ticket = @{
QueueID = 5
States = "new"
Result = "HASH"
}
}
$json = $TicketData | ConvertTo-Json
$Result = Invoke-RestMethod -Method Post -Headers $headers -ContentType 'application/json' -Uri $uri -Body $json
Write-Host Created ticket $Result.TicketNumber