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 2019-08-19 10:11:33

VincentGelot
Member
Registered: 2019-08-19
Posts: 4

How to search from custom field

Hello,
I would like to update and make research on customs fields via the API.
I succeeded to create/update fields with the API thanks to this post #id=161624
But I didn't succeed to have responses from the API when I request this field.
I always get the answer: 400 : ['ERROR', 'Bad field ID in search criteria; view documentation in your browser at ]
For the id field, I retrieved it by searching directly in the GLPI dashboard and get it in the URL (#76665 in my case).

1) How can I know all the id fields? To be sure that I request the correct field?
2) It is possible to request a search for customs fields? And how can I do this?

To test it, I set the same content in the field comment and my custom field.
When I request on the id #16, I get the correct response, when I request on the id #76665, I get Error 400.


My configuration :
GLPI 9.3.2

Plugins :
Additionnal fields :  1.8.2
File injection :       2.6.4
Form Creator :       2.8.2
More Reporting :     1.5.3
OCS Inventory NG : 1.5.6
Reports :                  1.12.0

Thanks

Offline

#2 2019-08-26 12:11:54

VincentGelot
Member
Registered: 2019-08-19
Posts: 4

Re: How to search from custom field

Hello,
No one got this error? Or try to search on a custom field (in softwarelicense)?

Regards,
Vincent

Offline

#3 2019-09-18 16:36:35

ronnie.peeters
Member
From: Eindhoven, the Netherlands
Registered: 2016-10-09
Posts: 72

Re: How to search from custom field

VincentGelot wrote:

Hello,
No one got this error? Or try to search on a custom field (in softwarelicense)?

Regards,
Vincent

Did not try to search on a custom field.
Did you make any progress??


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

#4 2019-09-30 11:21:46

VincentGelot
Member
Registered: 2019-08-19
Posts: 4

Re: How to search from custom field

Hello,
Still the same error, right now, I use the comment field as a workaround...

Regards,
Vincent

Offline

#5 2019-12-06 17:44:40

VincentGelot
Member
Registered: 2019-08-19
Posts: 4

Re: How to search from custom field

Hello,
I did other tests today.
I have a custom field for the computer object (keyboard) and another custom field for the licensesoftware object (arrivaldate).
In the computer object, I can retrieve the id for the keyboard field (/apirest.php/listSearchOptions/Computer) and so requested with this field.
But I cannot retrieve my custom field for the license software (/apirest.php/listSearchOptions/softwarelicense)
Is there a restriction with the licensesoftware object?

No problem to update the field arrivaldate by their name (arrivaldatefield)
Regards

Last edited by VincentGelot (2019-12-06 17:51:49)

Offline

Board footer

Powered by FluxBB