GLPI 10 API REST On creation date setting problem

Viewed 75

I am writing a php script that will transfer ticket from our previous ticketing solution to GLPI 10.

I made a first version for it while we were still on GLPI 9 and had no problem. But now, after the version change I can't set the "closedate" and "solvedate" of tickets I'm creating. I'd like to know if this is a new rule in GLPI 10 or if the way to do it changed. Or if anyone knows how to solve this problem

Here's an example of which route I call and what I pass to it :

Image showing the route and JSON

Route : glpi.com/apirest.php/Ticket

Json passed :

{"input": { 
    "_users_id_requester":12,
    "date_creation": "2022-05-11 08:01:20",
    "closedate": "2022-05-12 08:03:09",
    "solvedate": "2022-05-13 08:03:09",
    "date_mod": "2022-05-14 08:03:09",
    "date":"2022-05-17 08:01:20",
 "content": "Ticket test GLPI10 pbm date",
 "users_id": 12, 
 "itilcategories_id": 25, 
 "name": "Test de pre set date", 
 "type": 1}}

Server's answer :

{
    "id": 15681,
    "message": "Élément ajouté : Test de pre set date"
}

But then in GLPI, the ticket's date are all replaced by the value of the "date" parameter. And if I send it without the "date" parameter it takes today's date as value. The parameters I'm sending are the one I copied from the "GET Ticket" route.

Thanks in advance

0 Answers
Related