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 2021-12-14 00:21:05

aziz
Member
Registered: 2021-03-30
Posts: 109

change ticket actors

Hello Guys,
How can I change actors for a specific ticket
appreciate any help

Offline

#2 2021-12-14 19:20:04

LaDenrée
HELPER
Registered: 2012-11-19
Posts: 6,175

Re: change ticket actors

1) gets actors from tickets :

.../glpi/apirest.php/Ticket/ $ticket_id /Ticket_user/

2) find the actor you want to change ( get id, user_id, ticket id, type from answer

then
$id=  the id you get from first request corresponding to the user you wanna change  (not the user_id ..
$ticket_id, user_id   as usual

$type : 1 requester, 2 technician, 3 observer


payload : {"input" :{ "id": $id "tickets_id":$ticket_id  , "users_id":$tuser_id, "type":$type,"use_notification":1 } }

then use PUT method

.../glpi/apirest.php/Ticket/ $ticket_id /Ticket_user/  with payload abaove


Trouver la panne avant de réparer...
GLPI10.0.10 (ubuntu 22.04 PHP8.1  Mariadb10.6 ) plugins : comportements 2.7.2 reports 1.16.0 formcreator 2.13.8, datainjection 2.13.4 fields 1.21.6

Offline

#3 2021-12-14 22:50:25

aziz
Member
Registered: 2021-03-30
Posts: 109

Re: change ticket actors

Thanks this works, but is there a way to do it directly like using :

.../glpi/apirest.php/Ticket/ $ticket_id

payload : {"input":{"_users_id_assign":x,
                 "_users_id_watcher":x,
                 "_users_id_requester":x}}

then use  PUT method

I tried this but the users doesn"t change

Last edited by aziz (2021-12-14 22:50:56)

Offline

#4 2021-12-15 01:19:56

LaDenrée
HELPER
Registered: 2012-11-19
Posts: 6,175

Re: change ticket actors

this would mean, a ticket has only 1 requester, 1 observer, 1 technician, in fact a ticket can be associated with many actors :

if you have 2 requesters, wich user shall _users_id_requester refer to ???? 

that's why you can't change directly.


Trouver la panne avant de réparer...
GLPI10.0.10 (ubuntu 22.04 PHP8.1  Mariadb10.6 ) plugins : comportements 2.7.2 reports 1.16.0 formcreator 2.13.8, datainjection 2.13.4 fields 1.21.6

Offline

#5 2021-12-15 03:48:53

aziz
Member
Registered: 2021-03-30
Posts: 109

Re: change ticket actors

thank you for your help!

Last edited by aziz (2021-12-15 03:49:04)

Offline

Board footer

Powered by FluxBB