From e19cf74e68ef0ebad22df8a4165a93b897d863b9 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 12 Feb 2010 01:35:33 +0000 Subject: add ticket creation to self-service API, RT#7007 --- fs_selfservice/perl/xmlrpc-create_ticket.pl | 38 +++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 fs_selfservice/perl/xmlrpc-create_ticket.pl (limited to 'fs_selfservice/perl') diff --git a/fs_selfservice/perl/xmlrpc-create_ticket.pl b/fs_selfservice/perl/xmlrpc-create_ticket.pl new file mode 100755 index 000000000..cd2037e2c --- /dev/null +++ b/fs_selfservice/perl/xmlrpc-create_ticket.pl @@ -0,0 +1,38 @@ +#!/usr/bin/perl + +use strict; +use Frontier::Client; +use Data::Dumper;; + +my $server = new Frontier::Client ( + url => 'http://localhost/selfservice/xmlrpc.cgi', +); + +my $result = $server->call('FS.SelfService.XMLRPC.login', + 'username' => '4155551212', + 'password' => '5454', + 'domain' => 'svc_phone', +); + +#print Dumper($result); +die $result->{'error'} if $result->{'error'}; + +my $session_id = $result->{'session_id'}; +warn "logged in with session_id $session_id\n"; + +my $t_result = $server->call('FS.SelfService.XMLRPC.create_ticket', + 'session_id' => $session_id, + 'requestor' => 'harveylala@example.com', + 'cc' => 'chiquitabanana@example.com', + 'subject' => 'Chiquita keeps sitting on me', + 'message' => "Isn't there something you can do about this?\n\nShe keeps waking me up!", +); + +die $t_result->{'error'} if $t_result->{'error'}; + +warn Dumper($t_result); + +my $ticket_id = $t_result->{'ticket_id'}; +warn "ticket $ticket_id created\n"; + +1; -- cgit v1.2.1