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

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

Offline

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

LaDenrée
HELPER
Registered: 2012-11-19
Posts: 6,287

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...
GLPI10.0.16 (ubuntu 22.04 PHP8.1  Mariadb10.6 ) plugins : comportements 2.7.3 reports 1.16.0 formcreator 2.13.9, datainjection 2.13.5 fields 1.21.9

Offline

Board footer

Powered by FluxBB