glpi-project/glpi

API items_softwareversions does not exist and datas are untraceable

Closed this issue · 1 comments

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

Version

1.0.17

Bug description

Hello,
We can't retry software version installed on computer.

I use powershell.

API Invoke-RestMethod "$uriGLPI/items_softwareversions" is not accessible

I attempted to compensate for the lack of an API by leveraging search queries, but the parameters are not being correctly processed or applied.

With this query the computerSoftwares.data.5 contains all software version :
$computerSoftwares = Invoke-RestMethod "$uriGLPI/search/Software?is_deleted=0&criteria[0][link]=AND&criteria[0][field]=72&criteria[0][searchtype]=notcontains&criteria[0][value]=0&criteria[1][link]=AND&criteria[1][field]=62&criteria[1][searchtype]=notequals&criteria[1][value]=0&criteria[2][link]=AND&criteria[2][itemtype]=Computer&criteria[2][meta]=1&criteria[2][field]=2&criteria[2][searchtype]=contains&criteria[2][value]=$($computer.id)&criteria[3][link]=AND&criteria[3][field]=1&criteria[3][searchtype]=contains&criteria[3][value]=^$($row.Logiciel)&itemtype=Software&start=0" -Headers @{"session-token" = $SessionTokenGLPI.session_token; "App-Token" = "$appTokenGLPI" }

If I try to search computer, bold text is not used in query and it return the computer for all version even if it does not exist :
$computerSoftwaresVersion = Invoke-RestMethod "$uriGLPI/search/Computer?is_deleted=0&criteria[0][link]=AND&criteria[0][field]=2&criteria[0][searchtype]=contains&criteria[0][value]=$($computer.id)&criteria[1][link]=AND&criteria[1][itemtype]=Software&criteria[1][meta]=1&criteria[1][field]=1&criteria[1][searchtype]=contains&criteria[1][value]=$($software.name)&criteria[2][link]=AND&criteria[2][itemtype]=Software&criteria[2][meta]=1&criteria[2][field]=5&criteria[2][searchtype]=contains&criteria[2][value]=$($version)&itemtype=Computer&start=0?is_deleted=0&criteria[0][link]=AND&criteria[0][field]=2&criteria[0][searchtype]=contains&criteria[0][value]=$($computer.id)**&criteria[1][link]=AND&criteria[1][itemtype]=Software&criteria[1][meta]=1&criteria[1][field]=1&criteria[1][searchtype]=contains&criteria[1][value]=$($software.name)&criteria[2][link]=AND&criteria[2][itemtype]=Software&criteria[2][meta]=1&criteria[2][field]=5&criteria[2][searchtype]=contains&criteria[2][value]=$($version)&itemtype=Computer&start=0**" -Headers @{"session-token" = $SessionTokenGLPI.session_token; "App-Token" = "$appTokenGLPI" }

Relevant log output

Page URL

No response

Steps To reproduce

No response

Your GLPI setup information

No response

Anything else?

No response

This issue has been closed as we only track bugs here.

You can get community support on forums or you can consider taking a subscription to get professional support.
You can also contact GLPI editor team directly.