You are not logged in.
Pages: 1
Hi
I'm able to create a ticket successfully with the API, but I have a problem in assigning the requester.
Our system is configured to allow anyone from a specified domain to create a ticket via mail receiver, and I want to be able to create a ticket for someone that is not a user in GLPI.
I know this can be done as it's possible to specify an email address in the requester field in a ticket for someone who isn't in the user database from the web interface, but I can't work out how to do it using the API.
I have tried setting :
"_users_id_requester": 0,
"alternative_email": "a@example.com",
But the requester field is always empty, and I've been unable to find any other info apart from that the users on a ticket are stored in the glpi_tickets_users table. I must be missing something simple, and I've been unable to find any documentation for how to manipulate requesters.
Any help greatly appreciated!
Thanks, David
Offline
Hi all
I've upgraded to the latest version of GLPI and I'm still having the problem.
If I try to create a ticket with
"_users_id_requester": 0,
"alternative_email": "a@email address"
in the parameters, it doesn't create a requester.
If I then try and update the ticket with the above, It creates a requester but tells me it's an invalid email address in the web interface
As I said in my original post, I can do this via the web interface, but I can't find the magic combination of settings to do it via the API.
Any suggestions?
Thanks
David
Last edited by djwhite (2021-04-21 15:08:04)
Offline
Bonsoir, Good-evening,
Did you set this :
Home > Setup > General > Assistance panel > Assistance Section > Allow anonymous ticket creation (helpdesk.receiver) => [Yes]
Regards
Last edited by homebrewtainy (2021-04-21 20:01:24)
Creuser, creuser... creuser.
GLPI 10.0.16 [ Linux el 9.4 | Apache/2.4.xx | mysql 15.1 MariaDB 10.5.xx | PHP 8.3.x ] - Apache HTTPS r-proxy [ Linux el 9.4 | Apache/2.4.xx ]
GLPI Inventory 1.3.5 | Data Injection 2.13.5 | Treeview (Arborescence) 1.10.2 | Behaviors (Comportements) 2.7.3
-- Any exchange not written in French comes from an automatic translation. --
Offline
Bonsoir
That is set to Yes.
I've managed to get this to work by making an additional call to /Tickets/ticket-number/Tickets_Users after the ticket is created with the following:
options.body = {"input":
{
"tickets_id": ticket.id,
"_users_id_requester": "0",
"alternative_email": "email-address",
"type": "1"
}
But I can't get it to work on ticket creation.
Regards
Last edited by djwhite (2021-04-21 21:17:34)
Offline
Bonsoir
That is set to Yes.
I've managed to get this to work by making an additional call to /Tickets/ticket-number/Tickets_Users after the ticket is created with the following:
options.body = {"input":
{
"tickets_id": ticket.id,
"_users_id_requester": "0",
"alternative_email": "email-address",
"type": "1"
}But I can't get it to work on ticket creation.
Regards
we had the same task. and solve it.
{
"input":
{
"name": "issue",
"requesttypes_id":1,
"content":"444-444",
"_users_id_requester": 0,
"_users_id_requester_notif":
{
"use_notification":1,
"alternative_email":["user@mail.e"]
},
"_groups_id_assign":2,
"type": 1,
"status":"1",
"urgency":"1"
}
}
this json is uset to create ticket with email not a user
Last edited by rusakkl (2021-05-19 15:10:40)
Offline
Hi Rusakki
Thank you so much, that worked perfectly
All the best
David
Offline
I'm using this json to create a ticket but it is creating with status 'Processing (assigned)'... i'd like to create with status New =\ ... what should i do ?
Offline
remove "_groups_id_assign":2, then ticket status will be "New"
Trouver la panne avant de réparer...
GLPI10.0.16 (ubuntu 22.04 PHP8.1 Mariadb10.6 ) plugins : comportements 2.7.3 reports 1.16.0 formcreator 2.13.9, datainjection 2.13.5 fields 1.21.9
Offline
Pages: 1