You are not logged in.


 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-03-23 16:55:46

Registered: 2017-09-05
Posts: 2

Rest API and Requestor

Consider the following code:

$Headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
    $Headers.Add("App-Token", "$AppToken")
    $Headers.Add("Session-Token", "$Session_token")
    #generate properties for ticket object
    $props = @{
        'name'    = "$Title"
        'content' = "$Description"
        'status'  = '1'
        'itilcategories_id' = "5"

What I'm looking to do is create a ticket from the REST API with a a status of New. In playing with an existing ticket, and changing the status back and forth, I can see that I need to set status = 1 in the JSON body. The trouble is, whenever I send a new ticket via the API, it's setting it as Processing (Assigned). I know it's because my API user is being defined as the Requestor and the Assigned Technician upon ticket creation.

Scouring the returned JSON data from an existing ticket, I can't deduce what properties those to values are stored in? Ideally I'd like to put them in the JSON body of ticket creation request so that it shows a status of New without a requestor or assigned technician


#2 2018-03-24 13:18:14

Registered: 2012-11-19
Posts: 3,975

Re: Rest API and Requestor

Whatever you do, you can't set new status when ticket is assigned to technician BUT you can create tickets with no technicians ;

i think you use "initsession"  with a user login.
check  this user preferences :  pre select me as technician and set it  to NO.

so, ticket should not be assigned at creation and status is set to new

Last edited by LaDenrée (2018-03-24 14:20:37)

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.3(behaviours1.5.2+fusion9.2+1.0+applicatifs2.3.0+dashboard 0.8.9)hebergé sur serveur mutualisé.
*GLPI 9.3 RC2 en test (ubuntu 16.04 mariadb 10.2.4)


Board footer

Powered by FluxBB