Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional fields update using API or data injection plugin #790

Open
mareban opened this issue May 26, 2024 · 1 comment
Open

Additional fields update using API or data injection plugin #790

mareban opened this issue May 26, 2024 · 1 comment

Comments

@mareban
Copy link

mareban commented May 26, 2024

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

@renanredel
Copy link

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"
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants