Methods > glpi.addTicketObserver

This method is only accessible by authenticated users

Version Comments
1.2.0 Method added

Add a new observer to a existing ticket.
Current user can add himself to a ticket he can view.
Others users can be added if allowed to update the ticket.

input a hastable

  • help option to get usage information
  • ticket : ID of the ticket, mandatory
  • user : ID of the user to add, optional, default to connected user

return a hastable if succed (as for glpi.getTicket)

Call example

$php testxmlrpc.php --session=7d4hcvbohi2l1mur233b4ajll2 --method=glpi.addTicketObserver --ticket=290
+ Calling 'glpi.addTicketObserver' on http://localhost//glpi080/plugins/webservices/xmlrpc.php?session=7d4hcvbohi2l1mur233b4ajll2
+ Response: Array
(
    [id] => 290
    [entities_id] => 1
    [name] => Need help 5/7
    [date] => 2011-07-05 07:31:11
    [closedate] => 
    [solvedate] => 
    [date_mod] => 2011-07-05 09:01:05
    [users_id_lastupdater] => 6
    [status] => new
...
    [users] => Array
        (
            [requester] => Array
                (
                    [0] => Array
                        (
                            [id] => 413
                            [users_id] => 8
                            [use_notification] => 1
                            [alternative_email] => 
                        )
                )
            [observer] => Array
                (
                    [0] => Array
                        (
                            [id] => 419
                            [users_id] => 6
                            [use_notification] => 1
                            [alternative_email] => 
                        )
                )
            [assign] => Array
                (
                )
        )
...
    [events] => Array
        (
            [0] => Array
                (
                    [display_history] => 1
                    [id] => 18089094
                    [date_mod] => 05-07-2011 09:01
                    [user_name] => REMI COLLET
                    [field] => User
                    [change] => add link with an item : "REMI COLLET" 
                    [datatype] => 
                )
...

$ php testxmlrpc.php --session=7d4hcvbohi2l1mur233b4ajll2 --method=glpi.addTicketObserver --ticket=290
+ Calling 'glpi.addTicketObserver' on http://localhost//glpi080/plugins/webservices/xmlrpc.php?session=7d4hcvbohi2l1mur233b4ajll2
xmlrpc error(16): Command not allowed (Already an observer for this ticket)