BZ-Client
view release on metacpan or search on metacpan
lib/BZ/Client/Bug/Attachment.pm view on Meta::CPAN
my $client = BZ::Client->new(
url => $url,
user => $user,
password => $password
);
my $comments = BZ::Client::Bug::Attachment->get( $client, $ids );
=head1 CLASS METHODS
This section lists the class methods, which are available in this module.
=head2 get
It allows you to get data about attachments, given a list of bugs and/or attachment ids.
Note: Private attachments will only be returned if you are in the insidergroup or if you are the submitter of the attachment.
Actual Bugzilla API method is "attachments".
=head3 History
Added in Bugzilla 3.6.
=head3 Parameters
Note: At least one of L</ids> or L</attachment_ids> is required.
In addition to the parameters below, this method also accepts the standard L<BZ::Client::Bug/include_fields> and L<BZ::Client::Bug/exclude_fields> arguments.
=over 4
=item ids
I<ids> (array) - An array that can contain both bug IDs and bug aliases. All of the attachments (that are visible to you) will be returned for the specified bugs.
=item attachment_ids
I<attachment_ids> (array) - An array of integer attachment ID's.
=back
=head3 Returns
A hash containing two items is returned:
=over 4
=item bugs
This is used for bugs specified in L</ids>. This is a hash, where the keys are the numeric ID's of the bugs and the value is an array of attachment obejcts.
Note that any individual bug will only be returned once, so if you specify an ID multiple times in L</ids>, it will still only be returned once.
=item attachments
Each individual attachment requested in L</attachment_ids> is returned here, in a hash where the numeric L</attachment_id> is the key, and the value is the attachment object.
=back
The return value looks like this:
{
bugs => {
1345 => [
{ (attachment) },
{ (attachment) }
],
9874 => [
{ (attachment) },
{ (attachment) }
],
},
attachments => {
234 => { (attachment) },
123 => { (attachment) },
},
}
An "attachment" as shown above is an object instance of this package.
=head3 Errors
=over 4
=item 100 - Invalid Bug Alias
If you specified an alias and there is no bug with that alias.
=item 101 - Invalid Bug ID
The C<bug_id> you specified doesn't exist in the database.
=item 102 - Access Denied
You do not have access to the C<bug_id> you specified.
=item 304 - Auth Failure, Attachment is Private
You specified the ID of a private attachment in the L</attachment_ids> argument, and you are not in the "insidergroup" that can see private attachments.
=back
=head2 add
This allows you to add an attachment to a bug in Bugzilla.
Actual Bugzilla API method is "add_attachment".
=head3 History
Added in Bugzilla 4.0.
The return value has changed in Bugzilla 4.4.
=head3 Parameters
An instance of this package or a hash containing:
=over 4
( run in 0.932 second using v1.01-cache-2.11-cpan-0bb4e1dffa6 )