1BZ::Client::Component(3U)ser Contributed Perl DocumentatiBoZn::Client::Component(3)
2
3
4
6 BZ::Client::Component - Client side representation of Product
7 Components in Bugzilla
8
10 version 4.4002
11
13 This class provides methods for accessing Product Component information
14 in the Bugzilla server.
15
16 my $client = BZ::Client->new( url => $url,
17 user => $user,
18 password => $password );
19
20 my $id = BZ::Client::Component->create( $client, \%params );
21 my $changes = BZ::Client::Component->update( $client, \%params );
22 my $ids = BZ::Client::Component->delete( $client, \%params );
23
25 This section lists the class methods, which are available in this
26 module.
27
28 create
29 $id = BZ::Client::Component->create( $client, \%params );
30
31 Returns the ID of the newly created Component.
32
33 History
34
35 Added in Bugzilla 5.0.
36
37 Marked experiemental as of Bugzilla 5.0.
38
39 Parameters
40
41 Some params must be set, or an error will be thrown. These params are
42 marked "Required".
43
44 name
45 name (string) The name of the new component.
46
47 Required.
48
49 product
50 product (string) The name of the product that the component must be
51 added to. This product must already exist, and the user have the
52 necessary permissions to edit components for it.
53
54 Required.
55
56 description
57 description (string) The description of the new component.
58
59 Required.
60
61 default_assignee
62 default_assignee (string) The login name of the default assignee of
63 the component.
64
65 Required.
66
67 default_cc
68 default_cc (array) An array of strings with each element
69 representing one login name of the default CC list.
70
71 default_qa_contact
72 default_qa_contact (string) The login name of the default QA
73 contact for the component.
74
75 is_open
76 is_open (boolean) 1 if you want to enable the component for bug
77 creations. 0 otherwise. Default is 1.
78
79 Returns
80
81 The ID of the newly-added component.
82
83 Errors
84
85 304 - Authorization Failure
86 You are not authorized to create a new component.
87
88 1200 - Component already exists
89 The name that you specified for the new component already exists in
90 the specified product.
91
92 update
93 $changes = BZ::Client::Component->update( $client, \%params );
94 @changes = BZ::Client::Component->update( $client, \%params );
95
96 This allows you to update one or more components in Bugzilla.
97
98 History
99
100 Added in Bugzilla 5.0.
101
102 Parameters
103
104 You must set one or both of "ids" or "names" to select the Component to
105 update.
106
107 Other parameters set or update values of the Component
108
109 ids ids (array) Numeric ID's of the components that you wish to update.
110
111 names
112 names (array of hashes) Names of the components that you wish to
113 update. The hash keys are "product" and "component", representing
114 the name of the product and the component you wish to change.
115
116 name
117 name (string) A new name for this component. If you try to set this
118 while updating more than one component for a product, an error will
119 occur, as component names must be unique per product.
120
121 description
122 description (string) The description of the new component.
123
124 Required.
125
126 default_assignee
127 default_assignee (string) The login name of the default assignee of
128 the component.
129
130 Required.
131
132 default_cc
133 default_cc (array) An array of strings with each element
134 representing one login name of the default CC list.
135
136 default_qa_contact
137 default_qa_contact (string) The login name of the default QA
138 contact for the component.
139
140 is_open
141 is_open (boolean) 1 if you want to enable the component for bug
142 creations. 0 otherwise.
143
144 Returns
145
146 An array of hashes with the following fields:
147
148 id id (int) The ID of the component that was updated.
149
150 changes
151 The changes that were actually done on this component. The keys are
152 the names of the fields that were changed, and the values are a
153 hash with two keys:
154
155 added
156 added (string) The value that this field was changed to.
157
158 removed
159 removed (string) The value that was previously set in this
160 field.
161
162 Note that booleans will be represented with the strings 1 and
163 0.
164
165 Here's an example of what a return value might look like:
166
167 [
168 {
169 id => 123,
170 changes => {
171 name => {
172 removed => 'FooName',
173 added => 'BarName'
174 },
175 default_assignee => {
176 removed => 'foo@company.com',
177 added => 'bar@company.com',
178 }
179 }
180 }
181 ]
182
183 Errors
184
185 51 - User does not exist
186 One of the contact e-mail addresses is not a valid Bugzilla user.
187
188 106 - Product access denied
189 The product you are trying to modify does not exist or you don't
190 have access to it.
191
192 706 - Product admin denied
193 You do not have the permission to change components for this
194 product.
195
196 105 - Component name too long
197 The name specified for this component was longer than the maximum
198 allowed length.
199
200 1200 - Component name already exists
201 You specified the name of a component that already exists.
202 (Component names must be unique per product in Bugzilla.)
203
204 1210 - Component blank name
205 You must specify a non-blank name for this component.
206
207 1211 - Component must have description
208 You must specify a description for this component.
209
210 1212 - Component name is not unique
211 You have attempted to set more than one component in the same
212 product with the same name. Component names must be unique in each
213 product.
214
215 1213 - Component needs a default assignee
216 A default assignee is required for this component.
217
218 delete
219 $ids = BZ::Client::Component->delete( $client, \%params );
220 @ids = BZ::Client::Component->delete( $client, \%params );
221
222 This allows you to delete one or more components in Bugzilla.
223
224 History
225
226 Added in Bugzilla 5.0.
227
228 Parameters
229
230 You must set one or both of these parameters.
231
232 ids ids (array) Numeric ID's of the components that you wish to delete.
233
234 names
235 names (array of hashes). Names of the components that you wish to
236 delete. The hash keys are "product" and "component", representing
237 the name of the product and the component you wish to delete.
238
239 Returns
240
241 An array of ID's that were deleted
242
243 Errors
244
245 106 - Product access denied
246 The product you are trying to modify does not exist or you don't
247 have access to it.
248
249 706 - Product admin denied
250 You do not have the permission to delete components for this
251 product.
252
253 1202 - Component has bugs
254 The component you are trying to delete currently has bugs assigned
255 to it. You must move these bugs before trying to delete the
256 component.
257
259 See BZ::Client::Exception
260
262 BZ::Client, BZ::Client::API, Bugzilla API
263 <https://www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Component.html>
264
266 · Dean Hamstead <dean@bytefoundry.com.au>
267
268 · Jochen Wiedmann <jochen.wiedmann@gmail.com>
269
271 This software is copyright (c) 2017 by Dean Hamstad.
272
273 This is free software; you can redistribute it and/or modify it under
274 the same terms as the Perl 5 programming language system itself.
275
276
277
278perl v5.32.0 2020-07-28 BZ::Client::Component(3)