forked from digitaltom/BugzillaClient
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BugzillaClientTest.pl
executable file
·47 lines (30 loc) · 1.38 KB
/
BugzillaClientTest.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/perl
use BugzillaClient;
use strict;
$BugzillaClient::bzDebug = 0;
#login to novell bugzilla:
my $jar = BugzillaClient::bzConnect( 'Digitaltom','' );
#login to another bugzilla
#$SUSE::BugzillaClient::bzBaseUrl = "http://bugs.otrs.org/";
#my $jar = SUSE::BugzillaClient::bzConnect( 'user','pwd' );
# Example for fetching a single Bug for a provided Bugid:
my $bug = BugzillaClient::getBug($jar, 507548);
print "Bugs short Desc: " . $bug->{short_desc} . "\n";
# Example fetching an Array of Bugs for the provided Query
# (Copy the Query URL from your Browser)
print "Querying list of Bugs: \n";
my $query = "https://bugzilla.novell.com/buglist.cgi?query_format=advanced&product=openSUSE.org&bug_status=NEEDINFO";
my @bugs = BugzillaClient::getBugs($jar, $query);
foreach my $bug (@bugs){
print $bug->{bug_id} . ": " . $bug->{short_desc} . "\n";
}
# Example fetching an Array of Bugs for the provided Query
# (Copy the Query URL from your Browser and add &ctype=csv)
# Fetching by CSV is much faster, but does not contain all the fields as getBugs()
print "Getting Bugs by parsing CSV: \n";
my $query = "https://bugzilla.novell.com/buglist.cgi?query_format=advanced&product=openSUSE+10.3&bug_status=NEEDINFO&ctype=csv";
my @bugs = BugzillaClient::getBugsCSV($jar, $query);
foreach my $bug (@bugs){
print $bug->{bug_id} . ": " . $bug->{short_desc} . "\n";
}
print "OK\n";