You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2021-04-14 00:25:04

djwhite
Member
Registered: 2015-10-25
Posts: 29

Assign a ticket to an email address not a user.

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

#2 2021-04-21 15:07:41

djwhite
Member
Registered: 2015-10-25
Posts: 29

Re: Assign a ticket to an email address not a user.

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

#3 2021-04-21 19:59:21

homebrewtainy
Member
Registered: 2020-04-04
Posts: 151

Re: Assign a ticket to an email address not a user.

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

#4 2021-04-21 21:17:12

djwhite
Member
Registered: 2015-10-25
Posts: 29

Re: Assign a ticket to an email address not a user.

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

#5 2021-05-19 15:08:30

rusakkl
Member
Registered: 2020-11-02
Posts: 4

Re: Assign a ticket to an email address not a user.

djwhite wrote:

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

#6 2021-05-20 11:53:52

djwhite
Member
Registered: 2015-10-25
Posts: 29

Re: Assign a ticket to an email address not a user.

Hi Rusakki

Thank you so much, that worked perfectly smile

All the best

David

Offline

#7 2021-07-25 22:12:57

mcesarpl
Member
Registered: 2021-07-25
Posts: 2

Re: Assign a ticket to an email address not a user.

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

#8 2021-07-26 09:27:01

LaDenrée
HELPER
Registered: 2012-11-19
Posts: 6,287

Re: Assign a ticket to an email address not a user.

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

Board footer

Powered by FluxBB