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
99 new()
100 Initialize WWW::Bugzilla object. If bug_number is passed in, will
101 initialize as existing bug. Will croak() unless the Bugzilla login
102 page on server specified returns a 200 or 404. new() supports the
103 following name-value parameters.
104
105 server (required)
106 URL of the bugzilla server you wish to interface with. Do not
107 place http:// or https:// in front of the url (see 'use_ssl'
108 option below)
109
110 email (required)
111 Your email address used by bugzilla, in other words your
112 bugzilla login.
113
114 password (required)
115 Bugzilla password.
116
117 use_ssl (optional)
118 If set, will use https:// protocol, defaults to http://.
119
120 NOTE: This option requires Crypt::SSLeay.
121
122 product
123 Bugzilla product name, required if entering new bug (not updat‐
124 ing).
125
126 bug_number (optional)
127 If you mean to update an existing bug (not create a new one)
128 include a valid bug number here.
129
130 version component status assigned_to resolution dup_id assigned_to
131 summary bug_number description os platform severity priority cc url
132 add_cc target_milestone status_whiteboard keywords depends_on
133 blocks additional_comments
134 These are fields that can be initialized on new(), useful for
135 new bugs. Please note that some of these fields apply only to
136 bugs being updated, and if you set them here, they will be
137 overridden if the value is already set in the actual bug on the
138 server. These fields also have thier own get/set methods (see
139 below).
140
141 product() version() component() status() assigned_to() resolution()
142 dup_id() assigned_to() summary() bug_number() description() os() plat‐
143 form() severity() priority() cc() url() add_cc() target_milestone()
144 status_whiteboard() keywords() depends_on() blocks() additional_com‐
145 ments()
146 get/set the value of these bug fields. Some apply only to new
147 bugs, some only to bugs being updated. commit() must be called to
148 save these permanently.
149
150 available()
151 Returns list of available options for field requested. Below are
152 known valid fields:
153
154 product platform os version priority severity component tar‐
155 get_milestone
156
157 product()
158 Set the Product for the bug
159
160 reassign()
161 Mark bug being updated as reassigned to another user. Takes email
162 address as parameter. Status/resolution will not be updated until
163 commit() is called.
164
165 mark_as_duplicate()
166 Mark bug being updated as duplicate of another bug number. Takes
167 bug number as argument. Status/resolution will not be updated
168 until commit() is called.
169
170 change_status()
171 Change status of bug being updated. Status/resolution will not be
172 updated until commit() is called. The following are valid options
173 (case-insensitive):
174
175 assigned fixed invalid wontfix later remind worksforme reopen veri‐
176 fied closed
177
178 add_attachment()
179 Adds attachment to existing bug - will not work for new bugs.
180 Below are available params:
181
182 * filepath (required)
183
184 * description (required)
185
186 * is_patch (optional boolean)
187
188 * content_type - Autodetected if not defined.
189
190 * comment (optional)
191
192 * finished - will not return object to update form if set
193 (optional boolean)
194
195 list_attachments()
196 Lists attachments that are attached to an existing bug - will not
197 work for new bugs.
198
199 get_attachment()
200 Get the specified attachment from an existing bug - will not work
201 for new bugs.
202
203 commit()
204 Submits bugzilla new or update form. Returns bug_number. Optionally
205 takes parameter finished- if set will you are done updating the
206 bug, and wil not return you to the update page.
207
208 check_error ()
209 Checks if an error was given, croaking if it did.
210
211 get_products ()
212 Gets a list of products
213
214 get_comments()
215 Lists comments made on an existing bug - will not work for new
216 bugs.
217
219 There may well be bugs in this module. Using it as I have, I just have
220 not run into any. In addition, this module does not support ALL of
221 Bugzilla's features. I will consider any patches or improvements, just
222 send me an email at the address listed below.
223
225 Maintained by:
226 Brian Caswell, bmc@shmoo.com
227
228 Originally written by: Matthew C. Vella, the_mcv@yahoo.com
229
231 WWW::Bugzilla - Module providing API to create or update Bugzilla bugs.
232 Copyright (C) 2003 Matthew C. Vella (the_mcv@yahoo.com)
233
234 Portions Copyright (C) 2006 Brian Caswell (bmc@shmoo.com)
235
236 This module is free software; you can redistribute it and/or modify it
237 under the terms of either:
238
239 a) the GNU General Public License as published by the Free Software
240 Foundation; either version 1, or (at your option) any later version,
241 or
242
243 b) the "Artistic License" which comes with this module.
244
245 This program is distributed in the hope that it will be useful,
246 but WITHOUT ANY WARRANTY; without even the implied warranty of
247 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either
248 the GNU General Public License or the Artistic License for more details.
249
250 You should have received a copy of the Artistic License with this
251 module, in the file ARTISTIC. If not, I'll be glad to provide one.
252
253 You should have received a copy of the GNU General Public License
254 along with this program; if not, write to the Free Software
255 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
256 USA
257
258
259
260perl v5.8.8 2007-04-18 Bugzilla(3)