Problem additional fields GLPI
Code of Conduct
- [x] I agree to follow this project's Code of Conduct
Is there an existing issue for this?
- [x] I have searched the existing issues
GLPI Version
GLPI 11.0.2
Plugin version
Plugin version 1.23.0
Bug description
Image I am experiencing an issue when trying to populate custom fields from the Plugin Fields extension via the API in GLPI 11.0.2 using Plugin Fields 1.23.0. Even when sending the payload in the format expected for version 11, the values are simply not applied to the ticket.
The JSON being sent looks like this:
_plugin_fields: { "3": { "9": "teste" } }
Where 3 is the container ID and 9 is the field ID. However, after creating the ticket, the field remains empty in GLPI. This behavior is consistent and can be observed in the attached screenshot.
In GLPI 10, this process worked correctly by sending the field names directly in the JSON, for example:
socidfield: "value", datadeocorrnciafield: "value", mittretticafield: "value", mittretcnicafield: "value"
In other words, in the previous version, custom fields were filled without any issues. In GLPI 11, the old format stopped working, and the new _plugin_fields format also does not seem to have any effect.
The expected behavior is that the value sent for the custom field should be stored in the ticket. The current behavior is that the ticket is created but the custom field remains empty, suggesting a possible bug in the Plugin Fields plugin or in how GLPI 11 handles these fields through the API.
Relevant log output
Page URL
No response
Steps To reproduce
No response
Your GLPI setup information
No response
Anything else?
No response
There has been no activity on this issue for some time and therefore it is considered stale and will be closed automatically in 10 days.
If this issue is related to a bug, please try to reproduce on latest release. If the problem persist, feel free to add a comment to revive this issue. If it is related to a new feature, please open a topic to discuss with community about this enhancement on suggestion website.
You may also consider taking a subscription to get professionnal support or contact GLPI editor team directly.
Hi @jeanmachadocx
You do not need to change the way the JSON is constructed. The payload containing the ticket information must also include the custom fields (as key/value pairs) coming from Fields.
⚠️ Please note: if multiple containers are created on the ticket, you must add a new c_id key with the container identifier. This allows the plugin to find the correct container and apply the values properly.
For example, if you have a field with ID 9 in container 3, the payload could look like this:
{
"name": "Ticket title",
"content": "Ticket description",
"c_id": 3,
"my_spcific_field": "foobar"
}
This way, the plugin knows exactly which container the field belongs to and can correctly store the value.
There has been no activity on this issue for some time and therefore it is considered stale and will be closed automatically in 10 days.
If this issue is related to a bug, please try to reproduce on latest release. If the problem persist, feel free to add a comment to revive this issue. If it is related to a new feature, please open a topic to discuss with community about this enhancement on suggestion website.
You may also consider taking a subscription to get professionnal support or contact GLPI editor team directly.