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 2019-01-15 11:58:24

Metal-Frog
Member
Registered: 2019-01-15
Posts: 5

[API] Closing tickets in 9.3.2

Hi,
I have a C# application that works on tickets in GLPI (create, update and close). It worked fine so far but after an update to 9.3.2 tickets couldn't be closed anymore.
This is my code:
            object par = new { input = new Object[] { new Dictionary<String, Object> { { "id", ticketId }, { "status", 6 } }} };
            string resp = glpiConnection.jsonResponse("Ticket", par, "PUT");
which is similar to:
            $url=$api_url . "/Ticket/";
            method PUT
            $input='{ "input": {"tickets_id": '.$ticket_id.' ,"status": "6"}}';

Any ideas?

Best regards, Tom

Offline

#2 2019-01-15 15:21:56

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

Re: [API] Closing tickets in 9.3.2

i think you should also  set ticket_id in url :

$url=$api_url . "/Ticket/".$ticket_Id ."/";

edit : add   missing ending  /


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

#3 2019-01-16 13:41:48

Metal-Frog
Member
Registered: 2019-01-15
Posts: 5

Re: [API] Closing tickets in 9.3.2

LaDenrée wrote:

i think you should also  set ticket_id in url :
$url=$api_url . "/Ticket/".$ticket_Id ;

Same result sad

Offline

#4 2019-01-16 14:59:17

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

Re: [API] Closing tickets in 9.3.2

did you check if you have some setting preventing ticket to be closed ?
( mandatory solution, time, lifecycle )
or is your profile allowed to close tickets in this entity ?


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

#5 2019-01-16 15:05:16

Metal-Frog
Member
Registered: 2019-01-15
Posts: 5

Re: [API] Closing tickets in 9.3.2

LaDenrée wrote:

did you check if you have some setting preventing ticket to be closed ?
( mandatory solution, time, lifecycle )
or is your profile allowed to close tickets in this entity ?

My solution used to work and closing the tickets manually also works. So everything should be right ...

Offline

#6 2019-01-16 15:11:47

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

Re: [API] Closing tickets in 9.3.2

i checked my 9.3.3 GLPI with :
$input='{ "input": {"tickets_id": '.$ticket_id.' ,"status": "6"}}';
        $url="/Ticket/".$ticket_id."/";

it works ( my ticket status was "solved" then changed to "closed" with api)


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

#7 2019-01-16 15:17:06

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

Re: [API] Closing tickets in 9.3.2

i dont see any issue about this in glpi 9.3.3 changelog

https://github.com/glpi-project/glpi/mi … 9?closed=1


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

#8 2019-01-16 15:22:16

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

Re: [API] Closing tickets in 9.3.2

i was wrong with my fisrt url  : i forgot ending /


      $url="/Ticket/".$ticket_id."/";


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

#9 2019-01-17 11:13:48

Metal-Frog
Member
Registered: 2019-01-15
Posts: 5

Re: [API] Closing tickets in 9.3.2

Thanks for your help!  I found out that it is an issue wirh IIS. I create a new topic for this.

Offline

#10 2019-01-28 09:19:59

mohamed.osama770
Guest
Registered: 2018-09-16
Posts: 3

Re: [API] Closing tickets in 9.3.2

Hi,

I'm trying to build a new C# application to work with GLPI to open tickets but i can't find a documentation for C# can you please share it with me on mohamed.osama770@gmail.com

Offline

#11 2019-01-28 09:23:05

Metal-Frog
Member
Registered: 2019-01-15
Posts: 5

Re: [API] Closing tickets in 9.3.2

I've used GLPI.NET which you can find here: https://github.com/finalbeta/GLPI.NET.
Let me know if you need further help.

Offline

#12 2019-01-28 09:25:07

mohamed.osama770
Guest
Registered: 2018-09-16
Posts: 3

Re: [API] Closing tickets in 9.3.2

I could found it but do you have any example of application i can use to start?

Offline

Board footer

Powered by FluxBB