Methods > glpi.setTicketValidation

This method is only accessible by authenticated users

Version Comments
1.5.0 Change value os statuses
1.2.0 Method added

Answer to a ticket approval request

input a hastable

  • help option to get usage information
  • approval : ID of the request, mandatory
  • status : integer, mandatory - must be from : 1 (none), 2 (waiting), 3 (accepted), 4 (refused)
  • comment : text, optional (mandatory if status=4)

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

Call example

$ php testxmlrpc.php --session=baso8erm06cdd6tqht3km6vf81 \
   --method=glpi.listTickets \
   --approver=6 \
   --approval=2 \
+ Calling 'glpi.listTickets' on http://localhost//glpi080/plugins/webservices/xmlrpc.php?session=baso8erm06cdd6tqht3km6vf81
+ Response: Array
(
    [0] => Array
        (
            [id] => 269
            [entities_id] => 1
...
        )
)

$ php testxmlrpc.php --session=baso8erm06cdd6tqht3km6vf81 \
   --method=glpi.getTicket \
   --ticket=269 
+ Calling 'glpi.getTicket' on http://localhost//glpi080/plugins/webservices/xmlrpc.php?session=baso8erm06cdd6tqht3km6vf81
+ Response: Array
(
    [id] => 269
...
    [global_validation] => 2
...
    [validations] => Array
        (
            [0] => Array
                (
                    [id] => 15
                    [entities_id] => 1
                    [users_id] => 6
                    [tickets_id] => 269
                    [users_id_validate] => 6
                    [comment_submission] => Can we do this ?
                    [comment_validation] => 
                    [status] => 2
                    [submission_date] => 2011-06-16 09:49:38
                    [validation_date] => 
                )
        )
...
)

$ php testxmlrpc.php --session=baso8erm06cdd6tqht3km6vf81 \
   --method=glpi.setTicketValidation \
   --approval=15 \
   --status=3 \
   "--comment=Yes we can" 
+ Calling 'glpi.setTicketValidation' on http://localhost//glpi080/plugins/webservices/xmlrpc.php?session=baso8erm06cdd6tqht3km6vf81
+ Response: Array
(
    [id] => 269
...
    [global_validation] => 3
...
    [events] => Array
        (
            [0] => Array
                (
                    [display_history] => 1
                    [id] => 18089182
                    [date_mod] => 21-07-2011 14:32
                    [user_name] => REMI COLLET
                    [field] => Validation
                    [change] => "Waiting for approval" --> "Granted" 
                    [datatype] => 
                )
...
        )
    [validations] => Array
        (
            [0] => Array
                (
                    [id] => 15
                    [entities_id] => 1
                    [users_id] => 6
                    [tickets_id] => 269
                    [users_id_validate] => 6
                    [comment_submission] => Can we do this ?
                    [comment_validation] => Yes we can
                    [status] => 4
                    [submission_date] => 2011-06-16 09:49:38
                    [validation_date] => 2011-07-21 14:28:49
                )
        )
...
)

$ php testxmlrpc.php --session=baso8erm06cdd6tqht3km6vf81 \
   --method=glpi.listTickets \
   --approver=6 \
   --approval=2        
+ Calling 'glpi.listTickets' on http://localhost//glpi080/plugins/webservices/xmlrpc.php?session=baso8erm06cdd6tqht3km6vf81
+ Response: Array
(
)