public String assignUserToTicket(String ticketID, String userID, String tipo, String sessionToken) throws Exception, IOException {
String retval = "";
try {
SDIEUtentePerTicket assigner = new SDIEUtentePerTicket();
assigner.setTickets_id(ticketID);
assigner.setUsers_id(userID);
assigner.setType(tipo);
assigner.setUse_notification("1");
String url = super.getSistemaTarget().URL_Servizi_REST + "Ticket/" + ticketID + "/Ticket_User/";
logger.debug(LOG_CAPTION + ": START assignUserToTicket from " + super.getSistemaTarget().URL_Servizi_REST + " - url: " + url +
" - assigner.getUsers_id(): " + assigner.getUsers_id());
HttpResponse con = this.getConnection(assigner.inputJsonize(), "POST", url, sessionToken, super.getSistemaTarget().API_Token);
if (con == null || !con.isValid() || con.getResponse() == null || con.getResponse().equals("")){
retval = LOG_CAPTION + ": assignUserToTicket from " + super.getSistemaTarget().URL_Servizi_REST +
" with response code: nessuna risposta dal sistema GLPI(url: " + url +
" - assigner.getUsers_id(): " + assigner.getUsers_id();
logger.error(retval);
}
}
catch (Exception e) {
retval = LOG_CAPTION + ": assignUserToTicket from " + super.getSistemaTarget().URL_Servizi_REST + " with response code: " + e.getMessage();
logger.error(retval);
}
logger.debug(LOG_CAPTION + ": END assignUserToTicket from " + super.getSistemaTarget().URL_Servizi_REST);
return retval;
}
The assigned user exists with the same login in the source and in the target system, so we are able to manage correcty the user id on both the GLPI installation.
The InitSession is performed through Application Token (Basic Authentication).
Can we help us to resolve this problem?
Thanks in advance