You are not logged in.
Pages: 1
Hi guys,
I have a problem with structure of object when i want to change it.
$obj = [
"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]
],
"_itil_assign" => ["_type" => " 0"],
"name" => "NEW TICKET",
"content" => "<p>NEW TICKET BY REST</p>",
"_link" =>
["link" => " 1",
"tickets_id_1" => "110",
"tickets_id_2" => "0"
],
"filename" => [" (binary)"],
"update" => "Save",
"_read_date_mod" => "2018-10-18 14:43:40",
"id" => "112"
],
"format" => 'json'
];
When i'm trying to update the ticket and assign watchers (_itil_observer) or assigned users (_itil_assign) the request din't change anything. It's work correct in interface but i cant implement it in request.
Can you tell me where is my mistake? Thanks!
Offline
I'ts not possible to set observers and assigned users from api at the moment .
In the api.class.php
//update item
$object = Toolbox::sanitize((array)$object);
returns only one level key=>value object. When you set in dept like
"_itil_observer" => [
"_type" => "user",
"users_id" => "487",
"use_notification" => [1],
"alternative_email" => ["some_mail@gmai.com]
]
the function returns empty string...
Last edited by aerozol (2018-10-22 14:04:48)
Offline
if you want to add users to a ticket :
$url=$api_url . "/Ticket/".$ticket_id."/Ticket_User/";
method POST
$input='{ "input": {"tickets_id": '.$ticket_id.' ,"users_id": '.$user_id.',"type": "2","use_notification": "1"}}';
with type :
// Requester 1;
// Assign 2;
// Observer 3;
Trouver la panne avant de réparer...
*GLPI 9.1.6+fusion9.1+1.1+behaviours1.5.0+reports+fields+appliances+pdf+badges+formcreator2.5.2 PHP7.0 Mariadb10
*GLPI 9.2.4(behaviours1.5.2+fusion9.2+1.0+applicatifs2.3.0+dashboard 0.8.9)hebergé sur serveur mutualisé.
*GLPI 9.4.0 en test (ubuntu 18.04 mariadb 10.2.4)
Offline
Thanks solved
Offline
Pages: 1