BZ-Client

 view release on metacpan or  search on metacpan

lib/BZ/Client/Bug.pm  view on Meta::CPAN


You tried to set the status field to a closed status, but you didn't specify a resolution.

=item 122 - Resolution On Open Status

This bug has an open status, but you specified a value for the resolution field.

=item 123 - Invalid Status Transition

You tried to change from one status to another, but the status workflow rules don't allow that change.

=back

=head2 update_see_also

 @changes = BZ::Client::Bug->update_see_also( $client, \%params );
 $changes = BZ::Client::Bug->update_see_also( $client, \%params );

Adds or removes URLs for the I<See Also> field on bugs. These URLs must point to some valid bug in some Bugzilla installation or in Launchpad.

=head3 History

This is marked as B<EXPERIMENTAL> in Bugzilla 4.4

Added in Bugzilla 3.4.

=head3 Parameters

=over 4

=item ids

An array of integers or strings. The IDs or aliases of bugs that you want to modify.

=item add

Array of strings. URLs to Bugzilla bugs. These URLs will be added to the I<See Also> field.

If the URLs don't start with C<http://> or C<https://>, it will be assumed that C<http://> should be added to the beginning of the string.

It is safe to specify URLs that are already in the I<See Also> field on a bug as they will just be silently ignored.

=item remove

An array of strings. These URLs will be removed from the I<See Also> field. You must specify the full URL that you want removed. However, matching is done case-insensitively, so you don't have to specify the URL in exact case, if you don't want to.

If you specify a URL that is not in the I<See Also> field of a particular bug, it will just be silently ignored. Invaild URLs are currently silently ignored, though this may change in some future version of Bugzilla.

=back

B<Note:> If you specify the same URL in both L</add> and L</remove>, it will be added. (That is, L</add> overrides L</remove>.)

=head3 Returns

A hash or hashref where the keys are numeric bug ids and the contents are a hash with one key, C<see_also>.

C<see_also> points to a hash, which contains two keys, C<added> and C<removed>.

These are arrays of strings, representing the actual changes that were made to the bug.

Here's a diagram of what the return value looks like for updating bug ids 1 and 2:

 {
     1 => {
         see_also => {
             added   => [(an array of bug URLs)],
             removed => [(an array of bug URLs)],
         }
     },
     2 => {
         see_also => {
             added   => [(an array of bug URLs)],
             removed => [(an array of bug URLs)],
         }
     }
 }

This return value allows you to tell what this method actually did.

It is in this format to be compatible with the return value of a future L</update> method.

=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 bug_id you specified doesn't exist in the database.

=item 102 - Access Denied

You do not have access to the bug_id you specified.

=item 109 - Bug Edit Denied

You did not have the necessary rights to edit the bug.

=item 112 - Invalid Bug URL

One of the URLs you provided did not look like a valid bug URL.

=item 115 - See Also Edit Denied

You did not have the necessary rights to edit the See Also field for this bug.

Before Bugzilla 3.6, error 115 had a generic error code of 32000.

=back

=head2 update_tags

 @changes = BZ::Client::Bug->update_tags( $client, \%params );
 $changes = BZ::Client::Bug->update_tags( $client, \%params );

Adds or removes tags on bugs.

Unlike Keywords which are global and visible by all users, Tags are personal and can only be viewed and edited by their author. Editing them won't send any notification to other users. Use them to tag and keep track of bugs.

Bugzilla will lower case the text of the tags. This doesn't seem to be documented.

B<Reminder:> to retrieve these tags, specify C<_extra> or the field name C<tags> in L</include_fields> when searching etc.

=head3 History

This is marked as B<UNSTABLE> in Bugzilla 4.4

Added in Bugzilla 4.4.

=head3 Parameters

=over 4

=item ids

An array of ints and/or strings--the ids or aliases of bugs that you want to add or remove tags to. All the tags will be added or removed to all these bugs.

=item tags

A hash representing tags to be added and/or removed. The hash has the following fields:

=over 4

=item add

An array of strings representing tag names to be added to the bugs.

It is safe to specify tags that are already associated with the bugs as they will just be silently ignored.

=item remove

An array of strings representing tag names to be removed from the bugs.

It is safe to specify tags that are not associated with any bugs as they will just be silently ignored.

=back

=back

=head3 Returns

A hash or hashref where the keys are numeric bug ids and the contents are a hash with one key, C<tags>.

C<tags> points to a hash, which contains two keys, C<added> and C<removed>.

These are arrays of strings, representing the actual changes that were made to the bug.

Here's a diagram of what the return value looks like for updating bug ids 1 and 2:

 {
     1 => {
         tags => {
             added   => [(an array of tags)],
             removed => [(an array of tags)],
         }
     },
     2 => {
         tags => {
             added   => [(an array of tags)],
             removed => [(an array of tags)],
         }
     }
 }

This return value allows you to tell what this method actually did.

=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 bug_id you specified doesn't exist in the database.

=item 102 - Access Denied

You do not have access to the bug_id you specified.

=back

=head2 new

 my $bug = BZ::Client::Bug->new( id => $id );

Creates a new bug object instance with the given ID.

B<Note:> Doesn't actually touch your bugzilla server.

See L</INSTANCE METHODS> for how to use it.

=head1 INSTANCE METHODS

This section lists the modules instance methods.

Once you have a bug object, you can use these methods to inspect and manipulate the bug.

=head2 id

 $id = $bug->id();
 $bug->id( $id );

Gets or sets the bugs ID.

=head2 alias



( run in 0.932 second using v1.01-cache-2.11-cpan-0bb4e1dffa6 )