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 2020-01-27 18:25:14

wtralui
Member
Registered: 2019-12-07
Posts: 25

[solved]Associate ticket via APIREST

Is there a way to assign a ticket to the other (making a ticket a parent ticket and the others associated with it a child ticket) via apirest?
I hunted in any way and was unsuccessful, I tried to use "groups_id" too
but it doesn't make sense, since this is to add such ticket to a specific group and not associate them with each other):

input" => [
            "_date" => "04-10-2018 09:44",
            "date" => "2018-10-04 09:44:13",
            "users_id_recipient" => "487",
//            "_time_to_own" => " ",
//            "time_to_own" => " ",
//            "_time_to_resolve" => " ",
//            "time_to_resolve" => " ",
//            "_internal_time_to_own" => " ",
//            "internal_time_to_own" => " ",
//            "_internal_time_to_resolve" => " ",
//            "internal_time_to_resolve" => " ",
            "type" => "1",
            "itilcategories_id" => "0",
            "status" => "1",
            "requesttypes_id" => "1",
            "urgency" => "3",
            "global_validation" => "1",
            "impact" => "3",
            "locations_id" => "5",
            "priority" => "3",
            "my_items" => "",
            "itemtype" => "0",
            "items_id" => "0",
            "_itil_requester" => ["_type" => " 0"],
            "_itil_observer" => [
                "_type" => "user",
                "users_id" => "487",
                "use_notification" => [1],
                "alternative_email" => ["some_mail@gmai.com]

these are some of the attributes that i found for the api but none are related to the association of a ticket with another

Last edited by wtralui (2020-01-27 18:27:45)

Offline

#2 2020-01-27 21:13:34

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

Re: [solved]Associate ticket via APIREST

$ticket_id1=2876;
$ticket_id2=2877;
$link =3; //1: link, 2: duplicates,3: child,4: parent;
$fields='{"input":{"tickets_id_1": '.$ticket_id1.',"tickets_id_2":'.$ticket_id2.',"link":'.$link.'}}';
$url="myserver/glpi/apirest.php/Ticket_ticket/";

then use POST method


Trouver la panne avant de réparer...
GLPI10.0.16 (ubuntu 22.04 PHP8.1  Mariadb10.6 ) plugins : comportements 2.7.3 reports 1.16.0 formcreator 2.13.9, datainjection 2.13.5 fields 1.21.9

Offline

#3 2020-01-29 16:06:12

wtralui
Member
Registered: 2019-12-07
Posts: 25

Re: [solved]Associate ticket via APIREST

LaDenrée wrote:

$ticket_id1=2876;
$ticket_id2=2877;
$link =3; //1: link, 2: duplicates,3: child,4: parent;
$fields='{"input":{"tickets_id_1": '.$ticket_id1.',"tickets_id_2":'.$ticket_id2.',"link":'.$link.'}}';
$url="myserver/glpi/apirest.php/Ticket_ticket/";

then use POST method

Thanksssssssssss bro!!

Offline

Board footer

Powered by FluxBB