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 2018-11-26 13:07:16

Corrano
Guest
Registered: 2018-03-20
Posts: 2

Rest API Solution

Hi, the is any option to add new Solution to ticket by API ?? I see that's possible to add new followup but i can't find any information about solutions sad

Offline

#2 2018-11-26 17:37:44

BoSaGa
Member
Registered: 2018-11-21
Posts: 10

Re: Rest API Solution

Build a PUT request toward the ticket_ID (url + "/Ticket/ID/") and specify those options :

- solutiontypes_id = "ID of the solution"
- solution = "Text of the solution"

If you opted for "Show GLPI ID", you should be able to see the IDs of your different Solutions.

If you don't know what i'm talking about write this in your browser (or build a GET request with "/SolutionType/ at the end of target url) :

yourGLPI_URL/apirest.php + "/SolutionType/" + "?Content-Type=application/json&app_token=aaaaaaaaaaaaaaaaaaaaaaaaaaaaa&session_token=sssssssssssssssssssssssssss"

If nothing returns, you have no Solution built yet.

Build one through a existing ticket, or go to : Home > Setup > Dropdowns > Solution Types.
You can even build solution templates !

Last edited by BoSaGa (2018-11-26 17:48:29)

Offline

#3 2018-11-26 19:10:38

LaDenrée
HELPER
Registered: 2012-11-19
Posts: 4,282

Re: Rest API Solution

with glpi9.3 you should  not update ticket but post a itilsolution

$url="...glpi/apirest.php/itilsolution/";
$ticketid="xxxx";
$json='{"input":
{"itemtype":"Ticket",
"items_id":"' . $ticketid .'",
"solutiontypes_id":2,
"solutiontype_name":null,
"content":"MySolutionDescription",
"status":3
}}';

status values are :

// STATUS
   const NONE      = 1; // none
   const WAITING   = 2; // waiting
   const ACCEPTED  = 3; // accepted
   const REFUSED   = 4; // rejected


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.3.3  en test (ubuntu 18.04 mariadb 10.2.4)

Offline

#4 2018-11-27 10:42:15

Corrano
Guest
Registered: 2018-03-20
Posts: 2

Re: Rest API Solution

Great ! It works big_smile Thank you very much for your help  smile

Offline

Board footer

Powered by FluxBB