fields icon indicating copy to clipboard operation
fields copied to clipboard

Additional fields update using API or data injection plugin

Open mareban opened this issue 1 year ago • 1 comments

Hello,

We've created a tab called "technical services" in Computers with several fields (criticality, support level, location, ....) mostly using dropdown list (select and multi-select) ! These fields are tags in Vsphere and Azure , but we would like to have them in GLPI as well.

Is there a way to update these fields using API instead of manual fill-in , is there other method like using data injection plugin to try to fill these fields using automation please ?

Thanks for your help

PS : we are using GLPI 10.0.10 and additional fields 1.20.6

mareban avatar May 26 '24 21:05 mareban

Hi @mareban, You can find the ID of the custom fields using there endpoint: get -> https://{{GLPI URL}}/apirest.php/listSearchOptions/{{itemType}}

Eg: https://{{GLPI URL}}/apirest.php/listSearchOptions/Change

You will get the ID and name of the field.

Eg:

    "76723": {
        "name": "custom field name",
        "table": "glpi_plugin_fields_changemudancas",
        "field": "notificaofield",
        "datatype": "specific",
        "nosearch": false,
        "nodisplay": false,
        "available_searchtypes": [
            "contains",
            "notcontains"
        ],
        "uid": "Change.PluginFieldsChangemudanca.plugin_fields_mtododeimplamentaofielddropdowns_id"

After that, you can just use the PUT/POST method to update the data.

eg:

{
  "input" :{
    "changes_id": 39,
    "notificaofield":  "0"
  }
}

renanredel avatar Jun 10 '24 21:06 renanredel

Hello,

This issue hasn't seen any activity for a while. To keep the tracker clean, we're closing it for now.

Please consider testing again with the latest version of the plugin. If the problem persists, feel free to reopen the issue or open a new one with updated details.

Thanks for your understanding!

stonebuzz avatar May 20 '25 08:05 stonebuzz