Methods > glpi.getTicket¶
This method is only accessible by authenticated users
Version | Comments |
1.6.0 | Items associated to a ticket are return in a tab (https://forge.glpi-project.org/projects/webservices/news) |
1.2.0 | New output with multi-actor, sla, validation and satisfaction |
0.2.0 | Method added |
Retrieve information on a existing ticket if the authenticated user can view it.
input a hastable
- help option to get usage information
- ticket : ID of the ticket
- id2name : option to enable id to name translation of dropdown fields
- fields of glpi_tickets (with param id2name you have more fields see glpi.listTickets
- followups an array of hastable : fields of *glpi_ticketfollowup*s (if user have right to see it)
- tasks an array of hastable : fields of glpi_ticketstasks (if user have right to see it)
- users an hashtable, for each role (requester, observer, assign), an array of hastable
- groups an hashtable, for each role (requester, observer, assign), an array of hastable
- documents an array of hastable : fields of glpi_documents
- events an array of hastable : fields of glpi_logs (if user have right to see it)
- validation an array of hastable : fields of glpi_ticketvalildations (if user have right to see it)
- satisfaction an hastable : fields of glpi_ticketsatisfactions
Response GLPI >= 0.85.3 for associated items
... [validation_percent] => 0 [items] => Array ( [0] => Array ( [itemtype] => Computer [items_id] => 1406 ) [1] => Array ( [itemtype] => Software [items_id] => 11060 ) ) [itemtype] => Computer [items_id] => 1406 [slalevels_next_id] => 0 ...
Call example GLPI 0.80.1
$ php testxmlrpc.php --session=dc0e3ujkp9o4jjilil3cfa9481 --method=glpi.getTicket --ticket=278 --id2name + Calling 'glpi.getTicket' on http://localhost//glpi080/plugins/webservices/xmlrpc.php?session=dc0e3ujkp9o4jjilil3cfa9481 + Response: Array ( [id] => 278 [entities_id] => 1 [name] => Test collecteur 28/6 [date] => 2011-06-28 13:26:26 [closedate] => 2011-07-04 10:20:13 [solvedate] => 2011-07-04 10:20:13 [date_mod] => 2011-07-04 10:20:13 [users_id_lastupdater] => 6 [status] => closed [users_id_recipient] => 6 [requesttypes_id] => 2 [suppliers_id_assign] => 0 [itemtype] => [items_id] => 0 [content] => My computer doesn't work [urgency] => 3 [impact] => 3 [priority] => 3 [ticketcategories_id] => 2 [type] => 1 [cost_time] => 10.0000 [cost_fixed] => 123.0000 [cost_material] => 0.0000 [ticketsolutiontypes_id] => 1 [solution] => Computer replaced by a new one [global_validation] => accepted [due_date] => [begin_waiting_date] => [sla_waiting_duration] => 0 [ticket_waiting_duration] => 313095013 [close_delay_stat] => -312999373 [solve_delay_stat] => -312999373 [takeintoaccount_delay_stat] => 12814 [actiontime] => 3600 [slas_id] => 0 [slalevels_id] => 0 [slalevels_next_id] => 0 [slalevels_next_date] => [users_name_recipient] => Remi [users_name_lastupdater] => Remi [suppliers_name_assign] => [ticketcategories_name] => Incident [entities_name] => France > Reims [status_name] => Clos [requesttypes_name] => E-Mail [ticketsolutiontypes_name] => Workaround [slas_name] => [slalevels_name] => [slalevels_next_name] => [urgency_name] => Moyenne [impact_name] => Moyen [priority_name] => Moyenne [type_name] => Incident [global_validation_name] => Acceptée [items_name] => Général [itemtype_name] => [users] => Array ( [requester] => Array ( [0] => Array ( [id] => 393 [users_id] => 8 [use_notification] => 1 [alternative_email] => [users_name] => Nelly ) ) [observer] => Array ( [0] => Array ( [id] => 397 [users_id] => 0 [use_notification] => 1 [alternative_email] => foo@bar.com [users_name] => foo@bar.com ) [1] => Array ( [id] => 396 [users_id] => 6 [use_notification] => 1 [alternative_email] => [users_name] => Remi ) ) [assign] => Array ( [0] => Array ( [id] => 392 [users_id] => 6 [use_notification] => 1 [alternative_email] => [users_name] => Remi ) ) ) [groups] => Array ( [requester] => Array ( ) [observer] => Array ( ) [assign] => Array ( [0] => Array ( [id] => 244 [groups_id] => 307 [groups_name] => Test ) ) ) [followups] => Array ( [0] => Array ( [id] => 294 [tickets_id] => 278 [date] => 2011-06-29 10:09:41 [users_id] => 6 [content] => I will replace it soon [is_private] => 0 [requesttypes_id] => 1 [users_name] => Remi [requesttypes_name] => Helpdesk ) ) [tasks] => Array ( [0] => Array ( [id] => 35 [tickets_id] => 278 [taskcategories_id] => 6 [date] => 2011-07-04 08:54:53 [users_id] => 6 [content] => done [is_private] => 0 [actiontime] => 3600 [users_name] => Remi [taskcategories_name] => Computer replacement ) ) [documents] => Array ( ) [events] => Array ( [0] => Array ( [display_history] => 1 [id] => 18089047 [date_mod] => 04-07-2011 10:20 [user_name] => Remi [field] => Date de résolution [change] => "-- " --> "04-07-2011 10:20" [datatype] => datetime ) ) [validations] => Array ( ) [satisfaction] => Array ( [id] => 21 [tickets_id] => 278 [type] => 1 [date_begin] => 2011-06-29 10:11:40 [date_answered] => 2011-07-04 10:26:56 [satisfaction] => 4 [comment] => Great, it work. ) )
Call example GLPI 0.72
$ php testxmlrpc.php --session=j4mp77bmqu428ff38gufl3fvi3 --method=glpi.getTicket --ticket=11 + Calling 'glpi.getTicket' on http://localhost//glpi072/plugins/webservices/xmlrpc.php?session=j4mp77bmqu428ff38gufl3fvi3 + Response: Array ( [id] => 11 [entities_id] => 1 [name] => test 2 [date] => 2009-08-17 09:49:07 [closedate] => [date_mod] => 2009-08-17 14:21:10 [status] => new [users_id] => 6 [users_id_recipient] => 6 [groups_id] => 1 [requesttypes_id] => 6 [users_id_assign] => 0 [suppliers_id_assign] => 0 [groups_id_assign] => 0 [itemtype] => 4 [items_id] => 15174 [content] => I can't send a mail [urgence] => 5 [impact] => 5 [priority] => 5 [user_email] => [use_email_notification] => 0 [realtime] => 0 [category] => 1 [cost_time] => 0.0000 [cost_fixed] => 0.0000 [cost_material] => 0.0000 [followups] => Array ( [0] => Array ( [id] => 28 [date] => 2009-08-17 14:20:23 [users_id] => 6 [content] => hello ) ) )