[freeside-commits] freeside/fs_selfservice/perl xmlrpc-create_ticket.pl, NONE, 1.1
Ivan,,,
ivan at wavetail.420.am
Thu Feb 11 17:35:35 PST 2010
Update of /home/cvs/cvsroot/freeside/fs_selfservice/perl
In directory wavetail.420.am:/tmp/cvs-serv6252/fs_selfservice/perl
Added Files:
xmlrpc-create_ticket.pl
Log Message:
add ticket creation to self-service API, RT#7007
--- NEW FILE: xmlrpc-create_ticket.pl ---
#!/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 at example.com',
'cc' => 'chiquitabanana at 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;
More information about the freeside-commits
mailing list