You are not logged in.
Pages: 1
Hello,
when creating a ticket using API I want to set the actors (Requester, Assigned To) so how should the payload look like to achieve this.
Ty in advance.
Offline
Hello,
when creating a ticket using API I want to set the actors (Requester, Assigned To) so how should the payload look like to achieve this.
Ty in advance.
you need use this:
method POST.
/apirest.php/Ticket/ticket_id/Ticket_User/
and your raw input data looks like this:
{
"input": {
"tickets_id": 1,
"users_id": 2,
"type": 2
}
}
type:
1: requester
2: assigned
3: observer
Offline
if you want to create tickets and associate actors in one step use this :
{
'name': 'title',
'content': 'content',
'_users_id_assign': 2,
'_users_id_requester': 2,
'_groups_id_assign': 1,
...
}
see here : https://forum.glpi-project.org/viewtopic.php?id=280849
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
Thank you LaDenrée for your help but do you have an idea how to set a watcher I tried "_users_id_watcher": but it didn't work .
Last edited by aziz (2021-11-09 17:52:09)
Offline
Thank you LaDenrée for your help but do you have an idea how to set a watcher I tried "_users_id_watcher": but it didn't work .
I will try again ....
you need use this:
method POST.
/apirest.php/Ticket/ticket_id/Ticket_User/
and your raw input data looks like this:
{
"input": {
"tickets_id": 1,
"users_id": 2,
"type": 2
}
}
type:
1: requester
2: assigned
3: observer
Offline
I saw your reply too mecmav but I was trying to do this in one request TY anyway
Last edited by aziz (2021-11-09 21:49:43)
Offline
I saw your reply too mecmav but I was trying to do this in one request TY anyway
did you manage to do it the way LaDenree said?
Offline
yes that's why I want to know how to do the same thing to set a watcher
Last edited by aziz (2021-11-10 02:01:06)
Offline
this should work :
{"input" :{
"name": "title",
"content": "content",
"_users_id_assign": 4880,
"_users_id_requester": 4880,
"_users_id_observer": 4880
}
}';
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
Hello.
It would be possible to add an observer as an email without a user, using the Rest API?
I have tried different payload to achieve it, like _users_alternative_email, alternative_email, but no success yet
I notice that in table glpi_tickets_users the registers with email as observer have the field userid = 0
I'm using GLPI 10.0.10.
Updated:
I have found a way to update the ticket and set an email as a ticket observer, without a existing user_id needed:
apirest.php/Ticket/ticket_id/Ticket_User/
{
"input": {
"id": $id_tickets_users_table,
"tickets_id": $ticket_id,
"users_id": "0",
"type": "2",
"use_notification": "1",
"alternative_email":"myobseveremail@mail.mail"
}
}
Last edited by gavilareal (2024-01-03 00:00:37)
Offline
Pages: 1