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
Member
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: 6,167

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

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

Corrano
Member
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