1Bugzilla(3) User Contributed Perl Documentation Bugzilla(3)
2
3
4
6 WWW::Bugzilla - Handles submission/update of bugzilla bugs via
7 WWW::Mechanize.
8
10 use WWW::Bugzilla;
11
12 # create new bug
13 my $bz = WWW::Bugzilla->new( server => 'www.mybugzilla.com',
14 email => 'buguser@bug.com',
15 password => 'mypassword' );
16
17 # enter info into some fields and save new bug
18
19 # get list of available version choices
20 my @versions = $bz->available('version');
21
22 # set version
23 $bz->version( $versions[0] );
24
25 # get list of available products
26 my @products = $bz->available('product');
27
28 # set product
29 $bz->product( $products[0] );
30
31 # get list of components available
32 my @components = $bz->available('component');
33
34 # set component
35 $bz->component( $components[0] );
36
37 # optionally do the same for platform, os, priority, severity.
38
39 $bz->assigned_to( 'joeschmoe@whatever.com' );
40 $bz->summary( $some_text );
41 $bz->description( $some_more_text );
42
43 # submit bug, returning new bug number
44 my $bug_number = $bz->commit;
45
46 # all of the above could have been done in a much easier
47 # way, had we known what values to use. See below:
48
49 my $bz = WWW::Bugzilla->new( server => 'www.mybugzilla.com',
50 email => 'buguser@bug.com',
51 password => 'mypassword'
52 version => 'Alpha',
53 product => 'MyProduct',
54 component => 'API',
55 assigned_to => 'joeschmoe@whatever.com',
56 summary => $some_text,
57 description => $some_more_text);
58
59 my $bug_number = $bz->commit;
60
61 # Below is an example of how one would update a bug.
62
63 my $bz = WWW::Bugzilla->new( server => 'www.mybugzilla.com',
64 email => 'buguser@bug.com',
65 password => 'mypassword'
66 bug_number => 46 );
67
68 # show me the chosen component
69 my $component = $bz->component;
70
71 # change component
72 $bz->component( 'Test Failures' );
73
74 $bz->add_cc( 'me@me.org' );
75
76 $bz->add_attachment( filepath => '/home/me/file.txt',
77 description => 'description text',
78 is_patch => 0,
79 comment => 'comment text here' );
80
81 $bz->additional_comments( "comments here");
82
83 # below are examples of changing bug status
84 $bz->change_status("assigned");
85 $bz->change_status("fixed");
86 $bz->change_status("later");
87 $bz->mark_as_duplicate("12");
88 $bz->reassign("someone@else.com");
89
90 $bz->commit;
91
93 WWW::Bugzilla currently provides an API to posting new Bugzilla bugs,
94 as well as updating existing Bugzilla bugs.
95
97 METHODS
98 new()
99 Initialize WWW::Bugzilla object. If bug_number is passed in, will
100 initialize as existing bug. Will croak() unless the Bugzilla login
101 page on server specified returns a 200 or 404. new() supports the
102 following name-value parameters.
103
104 server (required)
105 URL of the bugzilla server you wish to interface with. Do not
106 place http:// or https:// in front of the url (see 'use_ssl'
107 option below)
108
109 email (required)
110 Your email address used by bugzilla, in other words your
111 bugzilla login.
112
113 password (required)
114 Bugzilla password.
115
116 use_ssl (optional)
117 If set, will use https:// protocol, defaults to http://.
118
119 NOTE: This option requires Crypt::SSLeay.
120
121 product
122 Bugzilla product name, required if entering new bug (not
123 updating).
124
125 bug_number (optional)
126 If you mean to update an existing bug (not create a new one)
127 include a valid bug number here.
128
129 version component status assigned_to resolution dup_id assigned_to
130 summary bug_number description os platform severity priority cc url
131 add_cc target_milestone status_whiteboard keywords depends_on
132 blocks additional_comments
133 These are fields that can be initialized on new(), useful for
134 new bugs. Please note that some of these fields apply only to
135 bugs being updated, and if you set them here, they will be
136 overridden if the value is already set in the actual bug on the
137 server. These fields also have thier own get/set methods (see
138 below).
139
140 product() version() component() status() assigned_to() resolution()
141 dup_id() assigned_to() summary() bug_number() description() os()
142 platform() severity() priority() cc() url() add_cc() target_milestone()
143 status_whiteboard() keywords() depends_on() blocks()
144 additional_comments()
145 get/set the value of these bug fields. Some apply only to new
146 bugs, some only to bugs being updated. commit() must be called to
147 save these permanently.
148
149 available()
150 Returns list of available options for field requested. Below are
151 known valid fields:
152
153 product platform os version priority severity component
154 target_milestone
155
156 product()
157 Set the Product for the bug
158
159 reassign()
160 Mark bug being updated as reassigned to another user. Takes email
161 address as parameter. Status/resolution will not be updated until
162 commit() is called.
163
164 mark_as_duplicate()
165 Mark bug being updated as duplicate of another bug number. Takes
166 bug number as argument. Status/resolution will not be updated
167 until commit() is called.
168
169 change_status()
170 Change status of bug being updated. Status/resolution will not be
171 updated until commit() is called. The following are valid options
172 (case-insensitive):
173
174 assigned fixed invalid wontfix later remind worksforme reopen
175 verified closed
176
177 add_attachment()
178 Adds attachment to existing bug - will not work for new bugs.
179 Below are available params:
180
181 · filepath (required)
182
183 · description (required)
184
185 · is_patch (optional boolean)
186
187 · content_type - Autodetected if not defined.
188
189 · comment (optional)
190
191 · finished - will not return object to update form if set
192 (optional boolean)
193
194 list_attachments()
195 Lists attachments that are attached to an existing bug - will not
196 work for new bugs.
197
198 get_attachment()
199 Get the specified attachment from an existing bug - will not work
200 for new bugs.
201
202 commit()
203 Submits bugzilla new or update form. Returns bug_number. Optionally
204 takes parameter finished- if set will you are done updating the
205 bug, and wil not return you to the update page.
206
207 check_error ()
208 Checks if an error was given, croaking if it did.
209
210 get_products ()
211 Gets a list of products
212
213 get_comments()
214 Lists comments made on an existing bug - will not work for new
215 bugs.
216
218 There may well be bugs in this module. Using it as I have, I just have
219 not run into any. In addition, this module does not support ALL of
220 Bugzilla's features. I will consider any patches or improvements, just
221 send me an email at the address listed below.
222
224 Maintained by:
225 Brian Caswell, bmc@shmoo.com
226
227 Originally written by: Matthew C. Vella, the_mcv@yahoo.com
228
230 WWW::Bugzilla - Module providing API to create or update Bugzilla bugs.
231 Copyright (C) 2003 Matthew C. Vella (the_mcv@yahoo.com)
232
233 Portions Copyright (C) 2006 Brian Caswell (bmc@shmoo.com)
234
235 This module is free software; you can redistribute it and/or modify it
236 under the terms of either:
237
238 a) the GNU General Public License as published by the Free Software
239 Foundation; either version 1, or (at your option) any later version,
240 or
241
242 b) the "Artistic License" which comes with this module.
243
244 This program is distributed in the hope that it will be useful,
245 but WITHOUT ANY WARRANTY; without even the implied warranty of
246 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either
247 the GNU General Public License or the Artistic License for more details.
248
249 You should have received a copy of the Artistic License with this
250 module, in the file ARTISTIC. If not, I'll be glad to provide one.
251
252 You should have received a copy of the GNU General Public License
253 along with this program; if not, write to the Free Software
254 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
255 USA
256
257
258
259perl v5.12.0 2007-04-18 Bugzilla(3)