Methods > glpi.addTicketTask

This method is only accessible by authenticated users

Version Comments
1.7.0 Method added

Add a task to an existing ticket if the authenticated user can edit it.

input a hastable

  • help option to get usage information
  • ticket : ID of the ticket, mandatory
  • content : of the new task, mandatory
  • users_login : users login - if you want to check rights of user with checkApprobationSolution function for logged user not allowed, optional
  • category : ID of the category, optional
  • private : optional boolean, default 0
  • state :ID of the state, optional (info 0, todo 1, done 2)
  • time : numeric value in seconds (total duration of the task if you not plan it), optionnal
  • begin : date time of the begin of the planification, optional
  • end : date time of the end of the planification, optional
  • tech : ID of the user affected to the task, optional
  • group : ID of the group affected to the task, optional
return a hastable if succed (as for glpi.getTicket)
  • fields of glpi_tickets
  • tasks an array of hastable : fields of glpi_tickettasks

Call example

$ php testxmlrpc.php   --method=glpi.addTicketTask --ticket=16 "--content=a new message" 
+ Calling 'glpi.addTicketTask' on http://localhost//glpi91/plugins/webservices/xmlrpc.php?session=j4mp77bmqu428ff38gufl3fvi3
+ Response: Array
(
    [id] => 16
    [entities_id] => 1
    [name] => Need help
    [date] => 2009-08-25 10:30:50
    [closedate] => 
    [date_mod] => 2009-08-25 10:35:21
    [status] => new
    [users_id] => 6
    [users_id_recipient] => 6
    [groups_id] => 0
    [users_id_assign] => 0
    [suppliers_id_assign] => 0
    [groups_id_assign] => 0
    [itemtype] => 0
    [items_id] => 0
    [content] => I can't send a mail
    [urgence] => 3
    [impact] => 3
    [priority] => 3
    [user_email] => 
    [use_email_notification] => 0
    [realtime] => 16
    [ticketscategories_id] => 1
    [cost_time] => 0.0000
    [cost_fixed] => 0.0000
    [cost_material] => 0.0000
    [tasks] => Array
        (
            [0] => Array
                (
                    [id] => 134
                    [tickets_id] => 16
                    [taskcategories_id] => 0
                    [date] => 2017-06-13 14:24:18
                    [users_id] => 8
                    [content] => a new message
                    [is_private] => 0
                    [actiontime] => 3600
                    [begin] => 2017-06-13 14:15:00
                    [end] => 2017-06-13 15:15:00
                    [state] => 1
                    [users_id_tech] => 8
                    [groups_id_tech] => 0
                    [date_mod] => 2017-06-13 14:13:16
                    [date_creation] => 2017-06-13 14:13:16
                )
)