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 2023-07-18 10:10:21

sparsh
Member
Registered: 2023-07-06
Posts: 15

Mapping in Ticket Creation Process using APIs

I am using APIs for creating tickets in GLPI.

Below mentioned are demo Fields fetched from GET request:
    "id": 13,
    "entities_id": 1,
    "name": "Testing_ticket creation",
    "status": 2,
    "users_id_recipient": 12,
    "requesttypes_id": 4,
    "content": "Dummy data",
    "priority": 4,
    "itilcategories_id": 2,
    "type": 2,
    "global_validation": 4,
   
Can anyone please help with the mappings for these fields like - status (1-New, 2-Processing, 3-Pending, 4-Solved, 5-Closed) for the remaining fields.
Is there any documentation present under api documentation.

Offline

#2 2023-07-18 11:45:10

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

Re: Mapping in Ticket Creation Process using APIs

entities_id, users_id,"requesttypes_id", "itilcategories_id", => see associated tables  or administration>entities, administration>users , setup>dropdowns

priority( see  .../glpi/src/CommonITILobject.php

// STATUS
     switch ($value) {
            case 6:
                return _x('priority', 'Major');

            case 5:
                return _x('priority', 'Very high');

            case 4:
                return _x('priority', 'High');

            case 3:
                return _x('priority', 'Medium');

            case 2:
                return _x('priority', 'Low');

            case 1:
                return _x('priority', 'Very low');

Validation ( see  .../glpi/src/CommonITILValidation.php

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

Type( see  .../glpi/src/Ticket.php

// Request type
    const INCIDENT_TYPE = 1;
   // Demand type
    const DEMAND_TYPE   = 2;


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

#3 2023-07-18 12:44:04

cconard96
Moderator
Registered: 2018-07-31
Posts: 2,813
Website

Re: Mapping in Ticket Creation Process using APIs

sparsh wrote:

Can anyone please help with the mappings for these fields like - status (1-New, 2-Processing, 3-Pending, 4-Solved, 5-Closed) for the remaining fields.
Is there any documentation present under api documentation.

No. For hard-coded enums like those we do not have them all listed in documentation somewhere.
Although, if you have other fields you aren't sure what the possible values are/mean, I expect you could get fairly quick answers in the forum. I usually check the forums daily.

We are however working on a new high-level API to supplement the current low-level one.
This new API will bring improved documentation (among many other improvements to make is more user friendly) via OpenAPI/Swagger with each endpoint and field have documentation associated with them.

This new API will be included with 10.1.


GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.

Offline

Board footer

Powered by FluxBB