1BZ::Client::FlagType(3)User Contributed Perl DocumentatioBnZ::Client::FlagType(3)
2
3
4
6 BZ::Client::FlagType - The API for creating, changing, and getting info
7 on Flags
8
10 version 4.4002
11
13 This class provides methods for accessing and managing Flags in
14 Bugzilla.
15
16 my $client = BZ::Client->new( url => $url,
17 user => $user,
18 password => $password );
19
20 my %results = BZ::Client::FlagType->get( $client, \%params );
21 my $id = BZ::Client::FlagType->create( $client, \%params );
22 my @updates = BZ::Client::FlagType->update( $client, \%params );
23
25 This section lists the class methods, which are available in this
26 module.
27
28 get
29 $id = BZ::Client::FlagType->get( $client, \%params );
30
31 Get information about valid flag types that can be set for bugs and
32 attachments.
33
34 History
35
36 Added in Bugzilla 5.0.
37
38 Parameters
39
40 You must pass a product "name" and an optional "component" name.
41
42 product
43 product (string) The name of a valid product.
44
45 component
46 component (string) An optional valid component name associated with
47 the product.
48
49 Returns
50
51 A hash containing two keys, bug and attachment. Each key value is an
52 array of hashes, containing the following keys:
53
54 id id (int) An integer ID uniquely identifying this flag type.
55
56 name
57 name (string) The name for the flag type.
58
59 type
60 type (string) The target of the flag type which is either bug or
61 attachment.
62
63 description
64 description (string) The description of the flag type.
65
66 values
67 values (array) An array of string values that the user can set on
68 the flag type.
69
70 is_requesteeble
71 is_requesteeble (boolean) Users can ask specific other users to set
72 flags of this type.
73
74 is_multiplicable
75 is_multiplicable (boolean) Multiple flags of this type can be set
76 for the same bug or attachment.
77
78 Errors
79
80 106 - Product Access Denied
81 Either the product does not exist or you don't have access to it.
82
83 51 - Invalid Component
84 The component provided does not exist in the product.
85
86 create
87 $id = BZ::Client::FlagType->create( $client, \%params );
88
89 This allows you to create a new Flag Type in Bugzilla.
90
91 Marked as unstable as of Bugzilla 5.0.
92
93 Added in Bugzilla 5.0.
94
95 Parameters
96
97 Some params must be set, or an error will be thrown. These params are
98 noted as Required.
99
100 name
101 name (string) A short name identifying this type.
102
103 Required.
104
105 description
106 description (string) A comprehensive description of this type.
107
108 Required.
109
110 inclusions
111 inclusions (array) An array of strings or a hash containing product
112 names, and optionally component names. If you provide a string, the
113 flag type will be shown on all bugs in that product. If you provide
114 a hash, the key represents the product name, and the value is the
115 components of the product to be included.
116
117 For example:
118
119 [ 'FooProduct',
120 {
121 BarProduct => [ 'C1', 'C3' ],
122 BazProduct => [ 'C7' ]
123 }
124 ]
125
126 This flag will be added to All components of FooProduct, components
127 C1 and C3 of BarProduct, and C7 of BazProduct.
128
129 exclusions
130 exclusions (array) An array of strings or hashes containing product
131 names. This uses the same format as inclusions.
132
133 This will exclude the flag from all products and components
134 specified.
135
136 sortkey
137 sortkey (int) A number between 1 and 32767 by which this type will
138 be sorted when displayed to users in a list; ignore if you don't
139 care what order the types appear in or if you want them to appear
140 in alphabetical order.
141
142 is_active
143 is_active (boolean) Flag of this type appear in the UI and can be
144 set.
145
146 Default is true.
147
148 is_requestable
149 is_requestable (boolean) Users can ask for flags of this type to be
150 set.
151
152 Default is true.
153
154 cc_list
155 cc_list (array) An array of strings. If the flag type is
156 requestable, who should receive e-mail notification of requests.
157 This is an array of e-mail addresses which do not need to be
158 Bugzilla logins.
159
160 is_specifically_requestable
161 is_specifically_requestable (boolean) Users can ask specific other
162 users to set flags of this type as opposed to just asking the wind.
163
164 Default is true.
165
166 is_multiplicable
167 is_multiplicable (boolean) Multiple flags of this type can be set
168 on the same bug.
169
170 Default is true.
171
172 grant_group
173 grant_group (string) The group allowed to grant/deny flags of this
174 type (to allow all users to grant/deny these flags, select no
175 group).
176
177 Default is no group.
178
179 request_group
180 request_group (string) If flags of this type are requestable, the
181 group allowed to request them (to allow all users to request these
182 flags, select no group). Note that the request group alone has no
183 effect if the grant group is not defined!
184
185 Default is no group.
186
187 Returns
188
189 The ID of the newly-created group.
190
191 Errors
192
193 51 - Group Does Not Exist
194 The group name you entered does not exist, or you do not have
195 access to it.
196
197 105 - Unknown component
198 The component does not exist for this product.
199
200 106 - Product Access Denied
201 Either the product does not exist or you don't have editcomponents
202 privileges to it.
203
204 501 - Illegal Email Address
205 One of the e-mail address in the CC list is invalid. An e-mail in
206 the CC list does NOT need to be a valid Bugzilla user.
207
208 1101 - Flag Type Name invalid
209 You must specify a non-blank name for this flag type. It must no
210 contain spaces or commas, and must be 50 characters or less.
211
212 1102 - Flag type must have description
213 You must specify a description for this flag type.
214
215 1103 - Flag type CC list is invalid
216 The CC list must be 200 characters or less.
217
218 1104 - Flag Type Sort Key Not Valid
219 The sort key is not a valid number.
220
221 1105 - Flag Type Not Editable
222 This flag type is not available for the products you can
223 administer. Therefore you can not edit attributes of the flag type,
224 other than the inclusion and exclusion list.
225
226 update
227 @results = BZ::Client::FlagType->update( $client, \%params );
228 $results = BZ::Client::FlagType->update( $client, \%params );
229
230 This allows you to update a flag type in Bugzilla.
231
232 History
233
234 Added in Bugzilla 5.0.
235
236 Parameters
237
238 Note: The following parameters specify which products you are updating.
239 You must set one or both of these parameters.
240
241 ids ids (array of ints) Numeric ids of the flag types that you wish to
242 update.
243
244 names
245 names (array of strings) Names of the flag types that you wish to
246 update. If many flag types have the same name, this will change ALL
247 of them.
248
249 Note: The following parameters specify the new values you want to set
250 for the products you are updating.
251
252 name
253 name (string) A short name identifying this type.
254
255 description
256 description (string) A comprehensive description of this type.
257
258 inclusions
259 An array of strings or a hash containing product names, and
260 optionally component names.
261
262 If you provide a string, the flag type will be shown on all bugs in
263 that product.
264
265 If you provide a hash, the key represents the product name, and the
266 value is the components of the product to be included.
267
268 For example:
269
270 [ 'FooProduct',
271 {
272 BarProduct => [ 'C1', 'C3' ],
273 BazProduct => [ 'C7' ]
274 }
275 ]
276
277 This flag will be added to all components of "FooProduct",
278 components "C1" and "C3" of "BarProduct", and "C7" of "BazProduct".
279
280 exclusions
281 An array of strings or hashes containing product names.
282
283 This uses the same fromat as "inclusions".
284
285 This will exclude the flag from all products and components
286 specified.
287
288 sortkey
289 sortkey (int) A number between 1 and 32767 by which this type will
290 be sorted when displayed to users in a list; ignore if you don't
291 care what order the types appear in or if you want them to appear
292 in alphabetical order.
293
294 is_active
295 is_active (boolean) Flag of this type appear in the UI and can be
296 set.
297
298 is_requestable
299 is_requestable (boolean) Users can ask for flags of this type to be
300 set.
301
302 cc_list
303 cc_list (array) An array of strings. If the flag type is
304 requestable, who should receive e-mail notification of requests.
305 This is an array of e-mail addresses which do not need to be
306 Bugzilla logins.
307
308 is_specifically_requestable
309 is_specifically_requestable (boolean) Users can ask specific other
310 users to set flags of this type as opposed to just asking the wind.
311
312 is_multiplicable
313 is_multiplicable (boolean) Multiple flags of this type can be set
314 on the same bug.
315
316 grant_group
317 grant_group (string) The group allowed to grant/deny flags of this
318 type (to allow all users to grant/deny these flags, select no
319 group).
320
321 request_group
322 request_group (string) If flags of this type are requestable, the
323 group allowed to request them (to allow all users to request these
324 flags, select no group).
325
326 Note that the request group alone has no effect if the grant group
327 is not defined!
328
329 Returns
330 An array of hashes with the following fields:
331
332 id id (int) The ID of the product that was updated.
333
334 name
335 name (string) The name of the product that was updated.
336
337 changes
338 changes (hash) The changes that were actually done on this product.
339
340 The keys are the names of the fields that were changed, and the
341 values are a hash with two keys:
342
343 added
344 added (string) The value that this field was changed to.
345
346 removed
347 removed (string) The value that was previously set in this
348 field.
349
350 Note that booleans will be represented with the strings 1 and 0.
351
352 Here's an example of what a return value might look like:
353
354 [
355 {
356 id => 123,
357 changes => {
358 name => {
359 removed => 'FooFlagType',
360 added => 'BarFlagType'
361 },
362 is_requestable => {
363 removed => '1',
364 added => '0',
365 }
366 }
367 }
368 ]
369
370 Errors
371
372 51 - Group Does Not Exist
373 The group name you entered does not exist, or you do not have
374 access to it.
375
376 105 - Unknown component
377 The component does not exist for this product.
378
379 106 - Product Access Denied
380 Either the product does not exist or you don't have editcomponents
381 privileges to it.
382
383 501 - Illegal Email Address
384 One of the e-mail address in the CC list is invalid. An e-mail in
385 the CC list does NOT need to be a valid Bugzilla user.
386
387 1101 - Flag Type Name invalid
388 You must specify a non-blank name for this flag type. It must no
389 contain spaces or commas, and must be 50 characters or less.
390
391 1102 - Flag type must have description
392 You must specify a description for this flag type.
393
394 1103 - Flag type CC list is invalid
395 The CC list must be 200 characters or less.
396
397 1104 - Flag Type Sort Key Not Valid
398 The sort key is not a valid number.
399
400 1105 - Flag Type Not Editable
401 This flag type is not available for the products you can
402 administer. Therefore you can not edit attributes of the flag type,
403 other than the inclusion and exclusion list.
404
406 FIXME Not yet implemented
407
409 See BZ::Client::Exception
410
412 BZ::Client, BZ::Client::API, Bugzilla API
413 <https://www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/FlagType.html>
414
416 · Dean Hamstead <dean@bytefoundry.com.au>
417
418 · Jochen Wiedmann <jochen.wiedmann@gmail.com>
419
421 This software is copyright (c) 2017 by Dean Hamstad.
422
423 This is free software; you can redistribute it and/or modify it under
424 the same terms as the Perl 5 programming language system itself.
425
426
427
428perl v5.28.1 2019-02-02 BZ::Client::FlagType(3)