You are not logged in.
How to add and update value custom fields plugin with api REST?
Please help me,
Thanks
Offline
Same question here. Someone succeeded in this?
I am unable to find ANY documentation about it
GLPI 9.4.3 - Currently in Dev environment - preparing for production
-Preparing data migration from OSTicket to GLPI for the Ticketing/Helpdesk part.
-Preparing data migration from OrangeSCRUM to GLPI for the project management part.
@Working at a company that is responsible for the IT environment of over 4500 employees that have IT assets
Offline
Hello,
For instance, if you created a field "custom inventory number" in the computer object, you can read, write and update the field thru the computer object using the field name "custominventorynumberfield".
As simple as that :-)
Offline
Would it be so simple ... ? Let me try that. Thanks for the info!
GLPI 9.4.3 - Currently in Dev environment - preparing for production
-Preparing data migration from OSTicket to GLPI for the Ticketing/Helpdesk part.
-Preparing data migration from OrangeSCRUM to GLPI for the project management part.
@Working at a company that is responsible for the IT environment of over 4500 employees that have IT assets
Offline
do not forget the "field" part at the end of the field's name ;-)
Offline
I saw the field getting it from the rest api:
id : 8
name : lastupdatetimestampfield
label : Last Update Timestamp
type : datetime
plugin_fields_containers_id : 2
ranking : 3
default_value :
is_active : 1
is_readonly : 0
mandatory : 0
links : {@{rel=PluginFieldsContainer; href=https://myglpiserver/apirest.php/PluginFieldsContainer/2}}
Now I am struggling with another issue, I am unable to update any field. Asked a question about that in a new post.
GLPI 9.4.3 - Currently in Dev environment - preparing for production
-Preparing data migration from OSTicket to GLPI for the Ticketing/Helpdesk part.
-Preparing data migration from OrangeSCRUM to GLPI for the project management part.
@Working at a company that is responsible for the IT environment of over 4500 employees that have IT assets
Offline
do not forget the "field" part at the end of the field's name ;-)
Thanks Jean-Christophe, for your input.
GLPI 9.4.3 - Currently in Dev environment - preparing for production
-Preparing data migration from OSTicket to GLPI for the Ticketing/Helpdesk part.
-Preparing data migration from OrangeSCRUM to GLPI for the project management part.
@Working at a company that is responsible for the IT environment of over 4500 employees that have IT assets
Offline
Hello,
For instance, if you created a field "custom inventory number" in the computer object, you can read, write and update the field thru the computer object using the field name "custominventorynumberfield".
As simple as that :-)
Jean-Christophe,
The update succeeds, for fields that have the block type 'Insertion in the form (before save button)'
Fields that have a block type 'Add Tab' give me still a '200 OK' at the PUT webrequest, but the update is not processed!
Anything that I am missing?
GLPI 9.4.3 - Currently in Dev environment - preparing for production
-Preparing data migration from OSTicket to GLPI for the Ticketing/Helpdesk part.
-Preparing data migration from OrangeSCRUM to GLPI for the project management part.
@Working at a company that is responsible for the IT environment of over 4500 employees that have IT assets
Offline
I do not use this kind of custom field. Only the 'Insertion in form'.
Currently, I don't have any GLPI instance where I can try :-/
Offline
Hi,
I'm intersted with this but I do not understand
"Where" is this field ?
I add a custom field 'test' (insertion in the form..) in the 'Phone' object
In a Phone /1 object, I put 'test' in the 'test' field
here what API get me : apirest.php/Phone/1/
I don't see my 'test' field !
---
id 1
entities_id 0
name "tel01"
date_mod "2019-09-18 21:50:40"
contact ""
contact_num ""
users_id_tech 0
groups_id_tech 0
comment ""
serial ""
otherserial ""
locations_id 0
phonetypes_id 0
phonemodels_id 0
brand ""
phonepowersupplies_id 0
number_line ""
have_headset 0
have_hp 0
manufacturers_id 0
is_global 0
is_deleted 0
is_template 0
template_name null
users_id 0
groups_id 0
states_id 0
ticket_tco 0
is_dynamic 0
date_creation "2019-09-18 21:50:40"
is_recursive 0
Offline
Hello !
You must make a second call to insert the value in the custom field.
When you create a custom field group, the plugin will create a class here: / path / to / glpi / files / _plugins / fields / inc / {field group name}.
You open this file to retrieve the name of this class. ex:
"class PluginFieldsChangesixsevenseveneight extends CommonDBTM {...}"
Each class that extends "CommonDBTM" is accessible through the API.
API call:
1. initSession
2. recovery token session
3. ticket creation
4. insert value into custom fields /apirest.php/PluginFieldsChangesixsevenseveneight/
Tip: Run a test with a get query, to get the names of the fields to fill
Offline
it's ok...
thanks
... How could I know that !? is it writen somewhere ?
I also use generic object, and the away to access extra field is more "simple"!
Last edited by ecollet (2019-09-20 11:48:25)
Offline
Hello together,
I'm trying to get all custom fieldvalues or just all fields.
I have tried every variation for the api request: https://myglpiserver/apirest.php/PluginFieldsCustomField but neither of them have worked.
With: /apirest.php/listSearchOptions/Computer ... I found the correct custom fields but didn't understand how to add it to my request still.
I got some "random" custom fieldvalues with .../apirest.php/search/Computer/ but I would like to get all custom fieldvalues not just a few.
I hope you can help me here
Offline
How can I call up the custom fields in a computer asset? For a custom field with the name "Test", do I have to enter it like this?
$GLPI_Link + "/Computer/452/testfield
This does not work.
I would like to retrieve a custom field in an asset as in the example above and be able to update the field.
I can call up the fields or containers in this way:
$GLPI_Link + "/listSearchOptions/Computer/"
$GLPI_Link + "/PluginFieldsContainer/"
But I don't see a link to an asset or a way to change the values.
Offline