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 2024-03-06 18:18:04

gaetan.rouxel
Member
Registered: 2018-08-23
Posts: 13

API REST : Search TicketTasks - valeurs retournées

Bonjour à tous,

Nous sommes en train de réaliser un dev spé entre JIRA et GLPI. Et nous avons le besoin de rechercher des tâches et de récupérer des informations sur ces tâches.

Nottament les 2 éléments suivants :
- ID du ticket (Pour le traiter et l'indiquer à JIRA)
- ID de la tâche (Pour changer le status de la tâche)


L'API REST permet de uniquement de récupérer les informations suivantes :
"1":{"name":"Description"
"2":{"name":"Catégorie de tâches"
"3":{"name":"Date"
"4":{"name":"Suivi public"
"6":{"name":"Durée totale"
"7":{"name":"Statut"
"119":{"name":"Nombre de documents"

Pour l'ID du ticket, on peut le mettre dans le gabarit de tâche, coup de chance.

-> Seulement, nous sommes bien incapable de récupérer l'ID de la tâche ..

Savez vous comment est ce qu'on pourrait rajouter cela dans l'API REST ? C'est lié au coeur du produit et une aide sur le sujet permettrait de gagner bcp de temps de compréhension sur le fonctionnement de GLPI...

Offline

#2 2024-03-06 18:29:43

gaetan.rouxel
Member
Registered: 2018-08-23
Posts: 13

Re: API REST : Search TicketTasks - valeurs retournées

Hello everyone,
We are currently working on a development between JIRA and GLPI. We need to find some tasks using criterias and retrieve information about these tasks, specifically the following two elements:
Ticket ID (to process and indicate in JIRA)
Task ID (to change the task status)
The REST API currently allows us to retrieve only the following information:
"1":{"name":"Description"
"2":{"name":"Task Category"
"3":{"name":"Date"
"4":{"name":"Public Tracking"
"6":{"name":"Total Duration"
"7":{"name":"Status"
"119":{"name":"Number of Documents"
Fortunately, we can include the Ticket ID in the task template.
However, we are unable to retrieve the Task ID!
Do you know how we could add this to the REST API? This is closely related to the core functionality of the product, and any assistance on this matter would greatly save time in understanding how GLPI works.

Offline

#3 2024-03-06 22:49:33

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

Re: API REST : Search TicketTasks - valeurs retournées

Which version of GLPI are you using?
Can you provide the complete request you are making to the GLPI API to get this information?


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

#4 2024-03-11 10:28:05

gaetan.rouxel
Member
Registered: 2018-08-23
Posts: 13

Re: API REST : Search TicketTasks - valeurs retournées

Hello  cconard96,

Version is GLPI 10.0.11

And the complete request is :
curl -s -X GET -H Content-Type: application/json -H Session-Token:XXXXXXXXXXXXXXXX-H App-Token:XXXXXXXXXXXXXXXXXXXXXhttp://localhost/apirest.php/search/TicketTask?criteria[0][link]=AND&criteria[0][itemtype]=TicketTask&criteria[0][field]=2&criteria[0][searchtype]=contains&criteria[0][value]=SAV_MATERIEL&\criteria[1][link]=AND&criteria[1][field]=7&criteria[1][searchtype]=contains&criteria[1][value]=2&criteria[2][link]=AND&criteria[2][searchtype]=contains&criteria[2][value]=0&\range=0-10&forcedisplay[0]=1

This request works fine but I want the Task ID and the Ticket ID ....

Thanks for your help

Offline

#5 2024-03-11 12:54:56

gaetan.rouxel
Member
Registered: 2018-08-23
Posts: 13

Re: API REST : Search TicketTasks - valeurs retournées

found !

The correct request to use is : http://localhost/apirest.php/Ticket/TICKET_ID/TicketTask

And that's all smile

thanks a lot

Offline

Board footer

Powered by FluxBB