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 2021-01-26 23:33:42

gremyus
Member
Registered: 2021-01-26
Posts: 1

Getting Cost center value for Computer unit

Hello people smile

I'm pretty much new in GLPI platform.
Currently desperately trying to get "cost center" parameter - from drop down menu under Computer Asset. Asset->Computer->device->cost center value.
I wish to get this value using REST API in python. What would be the best approach ? Do some kind of search with some kind of criteria ? I do successfully get all other things for particular Computer device, though, yet don't have a clue how to get to cost center field. Need help smile
Thank you for any advice !

Offline

#2 2021-02-07 12:36:39

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

Re: Getting Cost center value for Computer unit

I dont see any "cost center" dropdown in computer : are you looking for informations in "management" tab ?


Trouver la panne avant de réparer...
GLPI10.0.10 (ubuntu 22.04 PHP8.1  Mariadb10.6 ) plugins : comportements 2.7.2 reports 1.16.0 formcreator 2.13.8, datainjection 2.13.4 fields 1.21.6

Offline

#3 2021-02-26 10:24:15

gorazdhr
Member
Registered: 2021-02-26
Posts: 3

Re: Getting Cost center value for Computer unit

Cost Center comes with FusionInventory plugin. We use GLPI version 9.5.2 + FusionInventory 9.5.0+1.0. In this version there has been a change in database schema and it seems that REST API has also changed. We also need to access "cost center" field, but have not yet discovered how.

If anybody knows, how to access this field through GLPI REST API, please let me know.

Last edited by gorazdhr (2021-02-26 12:51:55)

Offline

#4 2021-02-26 11:30:26

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

Re: Getting Cost center value for Computer unit

sorry, using glpi 9.5.3 +fusion 9.5.0+1.0  i can't find any field nor tab under computer or device called cost center.

did you create it with fields plugin or renamed some fields ?


Trouver la panne avant de réparer...
GLPI10.0.10 (ubuntu 22.04 PHP8.1  Mariadb10.6 ) plugins : comportements 2.7.2 reports 1.16.0 formcreator 2.13.8, datainjection 2.13.4 fields 1.21.6

Offline

#5 2021-02-26 12:50:09

gorazdhr
Member
Registered: 2021-02-26
Posts: 3

Re: Getting Cost center value for Computer unit

After inquiring in the company, I have just found out, that the "Cost Center" field is a custom field created with "Additional Fields" plugin.

Do you happen to know, how could we access these custom fields via GLPI REST API?

Offline

#6 2021-02-26 19:49:32

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

Re: Getting Cost center value for Computer unit

to get cost center, I would use GUI to search some asset using cost center criteria and then look at URL criterias.
one aof these criteria gives cost field ID . keep this ID in mind.

then search some assets using forcedisplay parameter  :   search/Computer?criteria[0]......&forcedisplay[0]=MyCostCenterFieldID

otherway to get CostCenter Field ID  is  .../glpi/apirest.php/listSearchOptions/Computer  and you'll get all fields ID to force display you need


Trouver la panne avant de réparer...
GLPI10.0.10 (ubuntu 22.04 PHP8.1  Mariadb10.6 ) plugins : comportements 2.7.2 reports 1.16.0 formcreator 2.13.8, datainjection 2.13.4 fields 1.21.6

Offline

#7 2021-03-01 09:07:03

gorazdhr
Member
Registered: 2021-02-26
Posts: 3

Re: Getting Cost center value for Computer unit

Thank you very much! This was very helpful.

Offline

Board footer

Powered by FluxBB