Closed bosquig closed 3 years ago
Same happened to me yesterday, on GLPI 9.4.5, through another endpoint.
To reproduce:
POST /apirest.php/ticket/
When I get this itil solution request, the users_id is different. The API posted the integration user that i was testing.
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.
Describe the bug
When adding a solution to a ticket through the API with a given "users_id", the input "users_id" is overriden by the current user which is a problem if we have a connector user handling API requests. Can you be consistant with the followup behavior for example ?
in itilsolution.class.php - prepareInputForAdd :
$input['users_id'] = Session::getLoginUserID();
whereas in itilfollowup.class.php - prepareInputForAdd :
To reproduce
POST /apirest.php/ITILSolution {"input":[{"content":"resolution","users_id":6,"itemtype":"Ticket","_auto_import":true,"items_id":2,"solutiontypes_id": 1,"add":true}]}
Expected behavior
If users_id of the request session is "1", the solution will be linked to users_id 1 instead of 6. (should be the user indicated in POST body and not current user)
Your GLPI setup (you can find it in Setup > General menu, System tab)