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-05-12 18:30:58

D.DAL
Member
Registered: 2023-04-06
Posts: 1

Comment mettre à jour la valeur d'un champ du plugin Fields ?

Bonjour,

Nous cherchons à mettre à jour par requête REST API Patch la valeur d'un champ date personnalisé créé avec le plugin Fields.

Ce champ date personnalisé fait partie d'un onglet spécifique des objets du type Computer.

Pour une raison inconnue, nous pouvons mettre à jour un champ standard (par exemple, le nom de l'ordinateur) par requête REST API Patch, mais pas ce champ date personnalisé. Dans les deux cas de figure, la requête REST API Patch ramène un résultat "True" pour l'Id de l'ordinateur ciblé, ce qui ne permet pas de comprendre pourquoi la mise à jour du champ date personnalisé échoue.

Nous utilisons bien pour désigner le champ date personnalisé dans la requête REST API Patch la valeur de la propriété "field" exposée par exemple par la requête REST API Get listSearchOptions/Computer. Nous utilisons bien dans la requête REST API Patch une valeur de date au format aaaa-mm-jj pour la mise à jour souhaitée. De façon plus générale, nous ne pouvons mettre à jour aucun champ personnalisé par requête REST API Patch (ils sont tous associés à des onglets spécifiques).

Est-ce que la requête REST API Patch doit s'appliquer à une autre "objet" que l'ordinateur ciblé pour que la mise à jour réussisse ? Et dans ce cas, de quel objet s'agit-il, comment y accède-t-on depuis l'ordinateur ciblé et quel est son identifiant ?

Merci d'avance pour votre aide.

----------------------------------------------------------------------------------------------------------------------

How to update the value of a Fields plugin field?

Hi

We are looking to update by REST API Patch request the value of a custom date field created with the Fields plugin.

This custom date field is part of a specific tab for Computer type objects.

For some unknown reason, we can update a standard field (e.g. computer name) per REST API Patch request, but not this custom date field. In both cases, the REST API Patch request returns a "True" result for the Id of the targeted computer, which does not make it possible to understand why the update of the custom date field fails.

To designate the custom date field in the REST API Patch request, we do indeed use the value of the "field" property exposed for example by the REST API request Get listSearchOptions/Computer. We are indeed using in the REST API Patch request a date value in the format yyyy-mm-dd for the desired update. More generally, we cannot update any custom field by REST API Patch request (they are all associated with specific tabs).

Does the REST API Patch request have to apply to a different "object" than the targeted computer for the update to succeed? And in this case, what object is it, how do we access it from the targeted computer and what is its identifier?

Thank you in advance for your help.

----------------------------------------------------------------------------------------------------------------------

GLPI 9.5.9
Fields 1.13.0

- (76703) Plugins - Dotation - Date de restitution indiquée par le bénéficiaire

	Name = Dotation - Date de restitution indiquée par le bénéficiaire
	table = glpi_plugin_fields_computerdotations
	field = datederestitutionindiqueparlebnficiairefield
	datatype = date
	uid = Computer.PluginFieldsComputerdotation.datederestitutionindiqueparlebnficiairefield

Last edited by D.DAL (2023-05-16 16:58:25)

Offline

Board footer

Powered by FluxBB