You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2022-06-29 17:57:45

H57
Member
Registered: 2022-06-29
Posts: 1

Date setting on creation problem

Hello,

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 the ticket 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.

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

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

Last edited by H57 (2022-07-04 14:09:26)

Offline

#2 2023-01-13 12:28:53

cmariage
Member
Registered: 2023-01-13
Posts: 1

Re: Date setting on creation problem

I have the same issue with GLPI 10.
When I try to send a ticket using the API, if the field "date" is NOT set, all the date fields (date_creation, solvedate, closedate) are filled with the current date (the moment I send the API request).
If the field "date" IS set, all the date fields are filled with the same value as the "date" field.
I have tried various things, such as specifying or not the mod_date, or give in the duration of the ticket in the fields "close_delay_stat", with no result.

Offline

Board footer

Powered by FluxBB