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-01-02 15:48:21

alexmicontini
Member
Registered: 2021-06-25
Posts: 13

Get the names of the urgency, priority and impact of a ticket

Hi,

How can I get from the API the urgency, priority or impact of a ticket in long form, not the ids?

I have tried with the parameter expand_dropdowns=true but it keeps returning the ids and not the names.

/glpi/apirest.php/Ticket/XXX?expand_dropdowns=true

"urgency": 2,
"impact": 3,
"priority": 2,
...

I would like the result to be:

"urgency": Low,
"impact": Medium,
"priority": Low,
...

regards.

Last edited by alexmicontini (2023-01-02 15:53:59)

Offline

#2 2023-01-03 15:52:52

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

Re: Get the names of the urgency, priority and impact of a ticket

These fields are not dropdowns in this sense. "expand_dropdowns" only affects fields that are configured in Setup > Dropdowns.
For non-configurable dropdown fields like these, it doesn't know how to translate the value stored in the database to the localized name.

We are currently working on a new API that would be more user-friendly, if not as powerful, that would exist alongside the current one. It should be more possible to have fields like this show the value and name at the same time in this new API. You can follow its development here:
https://github.com/glpi-project/glpi/pull/12221


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

#3 2023-01-03 19:45:30

alexmicontini
Member
Registered: 2021-06-25
Posts: 13

Re: Get the names of the urgency, priority and impact of a ticket

Hi @cconard96,

OK, i will follow the development of the new API.

Thank you very much for answering.

Great job.

Offline

Board footer

Powered by FluxBB