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 2020-08-05 18:46:52

Galaellien
Member
From: Lyon, France
Registered: 2020-08-04
Posts: 4

Retrieve custom field value with API

Hello

I'm using GLPI 9.5.1 with the plugin Fields (Champs supplémentaires) 1.11.0

I have created a block with custom fields. This block is associated to the itemtype Project.

I can see those custom fields with a GET query on /listSearchOptions/Project/
I can update a custom field with a PUT query using the custom field name.

But I can't figure out the query to retrieve the value of a custom field of an item.

For example, the output of /listSearchOptions/Project/ is:

...
    "76668": {
        "name": "DIT Firme - champ4",
        "table": "glpi_plugin_fields_projectdits",
        "field": "champfourfield",
        "datatype": "string",
        "nosearch": false,
        "nodisplay": false,
        "available_searchtypes": [
            "contains",
            "notcontains"
        ],
        "uid": "Project.PluginFieldsProjectdit.champfourfield"
    },
    "76669": {
        "name": "DIT Firme - chefdeprojet",
        "table": "glpi_plugin_fields_projectdits",
        "field": "chefdeprojetfield",
        "datatype": "string",
        "nosearch": false,
        "nodisplay": false,
        "available_searchtypes": [
            "contains",
            "notcontains"
        ],
        "uid": "Project.PluginFieldsProjectdit.chefdeprojetfield"
    }
}

How can I retrieve the value of the field "chefdeprojetfield" of the Project id n°1 ?

Thank you

Offline

#2 2020-08-07 13:07:13

Galaellien
Member
From: Lyon, France
Registered: 2020-08-04
Posts: 4

Re: Retrieve custom field value with API

I will answer to my post.

It is possible with GLPI 9.3.4 and Fields 1.8.2

The same query doesn't work with GLPI 9.5.1 and Fields 1.11.0
It returns no output at all, not even an error message.

Bug or feature ? I've raised an issue on github.

Offline

#3 2020-10-06 22:35:59

Fabguy
Member
Registered: 2018-04-09
Posts: 9

Re: Retrieve custom field value with API

Hello,
i confirm that i have exactly the same problem as Galaellien.
Will be there a fix soon ?

Regards

Offline

Board footer

Powered by FluxBB