summaryrefslogtreecommitdiff
path: root/fs_selfservice/perl
diff options
context:
space:
mode:
authorivan <ivan>2010-02-12 01:35:33 +0000
committerivan <ivan>2010-02-12 01:35:33 +0000
commite19cf74e68ef0ebad22df8a4165a93b897d863b9 (patch)
tree5afd7b934a9b22957a325877bba4c498fa65af8a /fs_selfservice/perl
parentc79fddf94eb1ee76858a83fdb0f6b2e23d93a874 (diff)
add ticket creation to self-service API, RT#7007
Diffstat (limited to 'fs_selfservice/perl')
-rwxr-xr-xfs_selfservice/perl/xmlrpc-create_ticket.pl38
1 files changed, 38 insertions, 0 deletions
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;