BZ::Client::Bug::Comment - Client side representation of an Comment on a Bug in Bugzilla
version 2.0_6
This class provides methods for accessing and managing comments in Bugzilla. Instances of this class are returned by BZ::Client::Bug::Comment::get.
my $client = BZ::Client->new( url => $url, user => $user, password => $password ); my $comments = BZ::Client::Bug::Comment->get( $client, $ids );
This section lists the class methods, which are available in this module.
This allows you to get data about comments, given a list of bugs and/or comment ids.
Actual Bugzilla API method is "comments".
Added in Bugzilla 3.4
Note: At least one of ids or comment_ids is required.
In addition to the parameters below, this method also accepts the standard include_fields and exclude_fields arguments.
ids (array) - An array that can contain both bug IDs and bug aliases. All of the comments (that are visible to you) will be returned for the specified bugs.
comment_ids (array) - An array of integer comment_ids. These comments will be returned individually, separate from any other comments in their respective bugs.
new_since (dateTime) - If specified, the method will only return comments newer than this time. This only affects comments returned from the ids argument. You will always be returned all comments you request in the comment_ids argument, even if they are older than this date.
A hash containing two items is returned:
This is used for bugs specified in ids. This is a hash, where the keys are the numeric ids of the bugs, and the value is a hash with a single key, comments, which is an array of comments. (The format of comments is described below.)
Note that any individual bug will only be returned once, so if you specify an id multiple times in ids, it will still only be returned once.
Each individual comment requested in comment_ids is returned here, in a hash where the numeric comment id is the key, and the value is the comment. (The format of comments is described below.)
A "comment" as described above is an object instance of this package.
If you specified an alias and there is no bug with that alias.
The bug_id you specified doesn't exist in the database.
You do not have access to the bug_id you specified.
You specified the id of a private comment in the comment_ids argument, and you are not in the "insider group" that can see private comments.
You specified an id in the comment_ids argument that is invalid--either you specified something that wasn't a number, or there is no comment with that id.
This allows you to add a comment to a bug in Bugzilla.
Actual Bugzilla API method is "add_comment".
Added in Bugzilla 3.2.
Modified to return the new comment's id in Bugzilla 3.4
Modified to throw an error if you try to add a private comment but can't, in Bugzilla 3.4.
An instance of this package or a hash containing:
id (int or string) Required - The id or alias of the bug to append a comment to.
comment (string) Required - The comment to append to the bug. If this is empty or all whitespace, an error will be thrown saying that you did not set the comment parameter.
is_private (boolean) - If set to true, the comment is private, otherwise it is assumed to be public.
Before Bugzilla 3.6, the is_private argument was called private, and you can still call it private for backwards-compatibility purposes if you wish.
work_time (double) - Adds this many hours to the "Hours Worked" on the bug. If you are not in the time tracking group, this value will be ignored.
The id of the newly-created comment.
You specified a work_time larger than the maximum allowed value of 99999.99.
The id you specified doesn't exist in the database.
You did not have the necessary rights to edit the bug.
You tried to add a private comment, but don't have the necessary rights.
You tried to add a comment longer than the maximum allowed length (65,535 characters).
Before Bugzilla 3.6, error 54 and error 114 had a generic error code of 32000.
Returns the HTML rendering of the provided comment text.
Actual Bugzilla API method is "render_comment".
Note: this all takes place on your Bugzilla server.
Added in Bugzilla 5.0.
text (string) Required - Text comment text to render
id The ID of the bug to render the comment against.
The HTML rendering
my $comment = BZ::Client::Bug::Comment->new( id => $bug_id, comment => $comment, is_private => 1 || 0, work_time => 3.5 );
Creates a new instance with the given details. Doesn't actually touch your Bugzilla Server - see add for that.
This section lists the modules instance methods.
bug_id (int) - The ID of the bug that this comment is on when reading
bug_id (int or string) - The id or alias of the bug to append a comment to when writing
comment (string) The actual text of the comment when reading
When writing, the comment to append to the bug. If this is empty or all whitespace, an error will be thrown saying that you did not set the comment parameter.
Max length is 65,535 characters.
Synonym for comment
Read and Write.
Max value is 99999.99
id (int) The globally unique ID for the comment.
Read only.
attachment_id (int) If the comment was made on an attachment, this will be the ID of that attachment. Otherwise it will be null.
Added to the return value in Bugzilla 3.6
count (int) - The number of the comment local to the bug. The Description is 0, comments start with 1.
Added to the return value in Bugzilla 4.4.
creator (string) - The login name of the comment's author.
Also returned as author, for backwards-compatibility with older Bugzillas. (However, this backwards-compatibility will go away in Bugzilla 5.0.)
In bugzilla 4.0, the author return value was renamed to creator.
See creator
time (dateTime) - The time (in Bugzilla's timezone) that the comment was added.
creation_time (dateTime) - This is exactly same as the time key. Use this field instead of time for consistency with other methods including "get" and "attachments". For compatibility, time is still usable. However, please note that time may be deprecated and removed in a future release of Bugzilla.
Added in Bugzilla 4.4.
BZ::Client, BZ::Client::API, Bugzilla API
Dean Hamstead <dean@bytefoundry.com.au>
Jochen Wiedmann <jochen.wiedmann@gmail.com>
This software is copyright (c) 2015 by Dean Hamstad.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install BZ::Client, copy and paste the appropriate command in to your terminal.
cpanm
cpanm BZ::Client
CPAN shell
perl -MCPAN -e shell install BZ::Client
For more information on module installation, please visit the detailed CPAN module installation guide.