summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2006-11-03 05:03:46 +0100
committermkanat%bugzilla.org <>2006-11-03 05:03:46 +0100
commitc387f4db6121b465c4d10035d8082eee3c016ef0 (patch)
treed6495f1a9b3bcf7197be5efd4d7eed50a877f2cc /contrib
parent98fd6a922d8f1fefc5598c0fec443e8568d5d06b (diff)
downloadbugzilla-c387f4db6121b465c4d10035d8082eee3c016ef0.tar.gz
bugzilla-c387f4db6121b465c4d10035d8082eee3c016ef0.tar.xz
Bug 355837: Make the webservice able to create bugs (bz_webservice_demo part)
Patch By Mads Bondo Dydensborg <mbd@dbc.dk> r=mkanat, a=justdave
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/bz_webservice_demo.pl50
1 files changed, 50 insertions, 0 deletions
diff --git a/contrib/bz_webservice_demo.pl b/contrib/bz_webservice_demo.pl
index aba7544f0..31ca880a6 100755
--- a/contrib/bz_webservice_demo.pl
+++ b/contrib/bz_webservice_demo.pl
@@ -48,6 +48,7 @@ my $Bugzilla_password;
my $Bugzilla_remember;
my $bug_id;
my $product_name;
+my $create_file_name;
GetOptions('help|h|?' => \$help,
'uri=s' => \$Bugzilla_uri,
@@ -56,6 +57,7 @@ GetOptions('help|h|?' => \$help,
'rememberlogin!' => \$Bugzilla_remember,
'bug_id:s' => \$bug_id,
'product_name:s' => \$product_name,
+ 'create:s' => \$create_file_name
) or pod2usage({'-verbose' => 0, '-exitval' => 1});
=head1 OPTIONS
@@ -99,6 +101,10 @@ Pass a bug ID to have C<bz_webservice_demo.pl> do some bug-related test calls.
Pass a product name to have C<bz_webservice_demo.pl> do some product-related
test calls.
+=item --create
+
+Specify a file that contains settings for the creating of a new bug.
+
=back
=head1 DESCRIPTION
@@ -238,6 +244,33 @@ if ($product_name) {
}
}
+=head2 Creating A Bug
+
+Call C<Bug.create> with the settings read from the file indicated on
+the command line. The file must contain a valid anonymous hash to use
+as argument for the call to C<Bug.create>.
+The call will return a hash with a bug id for the newly created bug.
+
+=cut
+
+if ($create_file_name) {
+ $soapresult = $proxy->call('Bug.create', do "$create_file_name" );
+ _die_on_fault($soapresult);
+ $result = $soapresult->result;
+
+ if (ref($result) eq 'HASH') {
+ foreach (keys(%$result)) {
+ print "$_: $$result{$_}\n";
+ }
+ }
+ else {
+ print "$result\n";
+ }
+
+}
+
+
+
=head1 NOTES
=head2 Character Set Encoding
@@ -247,6 +280,23 @@ encoding as Bugzilla does, or that it converts correspondingly when using the
web service API.
By default, Bugzilla uses UTF-8 as its character set encoding.
+=head2 Format For Create File
+
+The create format file is a piece of Perl code, that should look something like
+this:
+
+ {
+ product => "TestProduct",
+ component => "TestComponent",
+ summary => "TestBug - created from bz_webservice_demo.pl",
+ version => "unspecified",
+ description => "This is a description of the bug... hohoho",
+ op_sys => "All",
+ platform => "All",
+ priority => "P4",
+ severity => "normal"
+ };
+
=head1 SEE ALSO
There are code comments in C<bz_webservice_demo.pl> which might be of further