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

It is not possible to add values ​​to additional entity fields via API #856

Open
2 tasks done
topcon-roberto-coutinho opened this issue Nov 16, 2024 · 4 comments
Open
2 tasks done

Comments

@topcon-roberto-coutinho
Copy link

topcon-roberto-coutinho commented Nov 16, 2024

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

GLPI Version

10.0.16

Plugin version

1.21.15

Bug description

I'm making a post request to create an entity, but only the native fields are defined, the additional fields are blank, to create tickets I do the same and it works perfectly.

Example:

URI: .../apirest.php/Entity

Request Type: POST

{
"input":{
"name": "test",
"testonefield": "test value",
"entities_id": 0,
"level":2
}
}

In this example, the test entity is created, but the testonefield field is blank.

Relevant log output

No response

Page URL

No response

Steps To reproduce

No response

Your GLPI setup information

No response

Anything else?

No response

@stonebuzz
Copy link
Contributor

Hi @topcon-roberto-coutinho

Can you redo a test by adding a new field to the payload c_id

corresponding to the ID of the corresponding container

Best regards

@topcon-roberto-coutinho
Copy link
Author

Hi @stonebuzz ,
Thanks for your attention.

I didn't quite understand what the c_id property is and how to find it to create the entity

@stonebuzz
Copy link
Contributor

Is the container ID

image

@topcon-roberto-coutinho
Copy link
Author

Hi @stonebuzz

Thank you for your attention

I tried to create the entity by passing the "c_id" property, but it still didn't work, the entity was created only with the values ​​of the native fields.

URL: .../apirest.php/Entity
Method Type: POST
Body Json:
{
"input":{
"c_id": 2,
"name": "testeMap12",
"infraresponsvelemailfield": "[email protected]",
"infraresponsvelnomefield":"teste",
"comment":"teste comentario",
"entities_id": 0,
"level":2
}
}

"infraresponsvelemailfield" and "infraresponsvelnomefield" are the additional fields.

image

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