pluginsGLPI / fields

Additionals fields for GLPI
http://glpi-plugins.rtfd.io/en/latest/fields/index.html
GNU General Public License v2.0
90 stars 66 forks source link

Multibple dropdown field value not displaying when requesting though API #813

Open Growlert opened 2 months ago

Growlert commented 2 months ago

Hello. When I request computers list from GLPI, something like this (in Powershell): $Params = @{ uri = "$GlpiInstance/apirest.php/PluginFieldsComputercmdb?expand_dropdowns=true&range=0-2000" headers = @{ "Accept" = "application/json"; "App-Token" = $GlpiAppToken; "Session-Token" = $($GlpiAuth.session_token) } } $CMDBServers = Invoke-RestMethod @params -UseBasicParsing -SkipCertificateCheck

option expand_dropdowns=true should display names instead of ids and that is perfectly works with, say, simple dropdown. But with multiple dropdown I get emtpy value: glpi_api_empty_value

Without this option API returns list of ID, but I prefer names. How can I fix it?

Mirkk commented 1 month ago

Hi @Growlert, What's your GLPI version? These fields were completely empty till now,I opened a request, and Teclib did a fix with 10.0.16 so that it shows the list of IDs also with expand_dropdowns = true, that's much better than before, prevents errors and saves a REST call. I'm happy with this for now and with an additional request for each ID I easily get the names. For GLPI 11 a new REST api is planned, let's wait a bit and see.

Growlert commented 1 month ago

Hi, Mirkk. Thanks for the reply. I have 10.0.12 installed. Now I will consider to upgrade, hope it will not break something as I have multiple extensions installed also.