You are not logged in.
I'm using the API Rest to create a Ticket. The ticket has been created perfectly. But noone (requester, watcher) is receiving the e-mails.
I've made a test, I created a Ticket Test using the Aplicacation and everybody receives the notification (email) correctly.
Below is the Json I have used to create the ticket using the API
{ "name", "TEST" }, { "users_id", 21 }, { "type", 1 }, { "entities_id", 0 }, { "requesttypes_id", 1 }, { "status", 2 }, { "content", "Created by api " + DateTime.Now.ToLongDateString() }
Does Somebody know what can be happing here?
Thanks!!
Offline
after ticket has been created, have an requester assigned?
Offline
After I created the ticket, I created the Requester (type=1) using the API as well
API Url: Ticket/{ticketId}/Ticket_User
Json used
{ "tickets_id", {ticketId} }, { "users_id", 21 }, { "type", 1 }, { "use_notification", "1" }
Offline
the field "type" is used for assign the ticket type (incident or request).
use this URL and try to use your json like this:
http://yourIPGLPI/apirest.php/Ticket/
curl -X POST \
http://yourIPGLPI/apirest.php/Ticket/ \
-H 'App-Token: your app-token' \
-H 'Content-Type: application/json' \
-H 'Session-Token: your sess-token' \
-d '
{
"input": {
"users_id":587, user_id author (who are opening the ticket)
"type":1, //this is for incident
"itilcategories_id":112, //id of ticket category
"requesttypes_id":6,
"urgency":5,
"impact":5,
"priority":5,
"name":"title of the ticket",
"content":"description of the ticket"
}
}
'
Now to you automatically assign an observer or a requester to the ticket, create a business rule for ticket, based on criterions and actions that you need
Offline
I've created the Ticket as you said and put a Requester as well (using API).
But, I don't receive any notification by e-mail.
Now, the strange thing is, When I create a Ticket using de Application GLPI, the same Ticket information, I receive the e-mail notification. This is my headache.
Thanks!!
Offline
Look at Administration > Notifications queue
Have some register there?
Look too in the Notification > Email Followups Configuration
The admin email are correctly setup here?
I think some target's role missing ..
Offline
Are you using Linux?
Offline
If using Linux, try to view the log of the emails.
/var/www/glpi/files/_log/mail.log
and
/var/www/glpi/files/_log/mail-debug.log
on these files you can analyze what causing not deliver emails
Offline
when you create a ticket, glpi sends notifications to requester (event new ticket). at this time, requester is not assigned, so notification can not be send to requester.
What I Would do : set requester in the first JSON ( create ticket)
{ "input":
{ "entities_id": "2",
"name": "Demande d'infos",
"_users_id_assign": 6,
"_user_id_request": 15,
"requesttypes_id": 7,
"content": "Je voudrais avoir des infos concernant la problématique.....",
"urgency": 3,
"impact": 3,
"priority": 3,
"itilcategories_id": 189,
"time_to_resolve": "2018-09-24 12:00:00",
"type": 2
}
}
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
Will be useful: correct parameter name is "_users_id_requester", at least in my 10.0.3 version. You have a mistake.
Offline
_users_id_requester
when you create a ticket, glpi sends notifications to requester (event new ticket). at this time, requester is not assigned, so notification can not be send to requester.
What I Would do : set requester in the first JSON ( create ticket)
{ "input": { "entities_id": "2", "name": "Demande d'infos", "_users_id_assign": 6, "_user_id_request": 15, "requesttypes_id": 7, "content": "Je voudrais avoir des infos concernant la problématique.....", "urgency": 3, "impact": 3, "priority": 3, "itilcategories_id": 189, "time_to_resolve": "2018-09-24 12:00:00", "type": 2 } }
Offline