BZ::Cl...omment(3pm)
π BZ::Client::Bug::Comment π
okay bestie, welcome to the perl doc for BZ::Client::Bug::Comment, which lives in the BZ::Cl...omment(3pm) manual page β it's giving "client-side representation of a Comment on a Bug in Bugzilla" and honestly? iconic.
VERSION: version 4.91 β¨
πΈ SYNOPSIS πΈ
so this class is literally your whole comment-management bestie β it 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 );
π CLASS METHODS π
this section lists the class methods, which are available in this module. (class methods! plural! let's go π )
π¦ get π¦
my $comments = BZ::Client::Bug::Comment->get( $client, 1234 );
my $comments = BZ::Client::Bug::Comment->get( $client, { ids => \@list, commend_ids => \@list } );
this is how you get data about comments, given a list of bugs and/or comment ids. (and yes, commend_ids is spelled exactly like that up there in the synopsis β copy it verbatim, don't be a hero π)
the actual Bugzilla API method is "comments".
History
- Added in Bugzilla 3.4
Parameters
a single scalar is considered a search for "ids", otherwise a hash reference must be provided.
β οΈ Note: at least one of"ids"or"comment_ids"is required. no cap, you gotta give it something.
in addition to the parameters below, this method also accepts the standard "include_fields" in BZ::Client::Bug and "exclude_fields" in BZ::Client::Bug arguments.
idsβ ids (array) β an array that can contain both bug ID's and bug aliases. all of the comments (that are visible to you) will be returned for the specified bugs. πcomment_idsβ comment_ids (array) β an array of integer comment ID's. these comments will be returned individually, separate from any other comments in their respective bugs. main character comments only πnew_sinceβ 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. periodt.
Returns
a hash reference containing two items is returned. e.g.
{
bugs => {
123 => \@comments,
456 => \@comments,
},
comments => {
789 => $comment,
},
}
the Bugzilla WebService documentation doesnt state what order the comments will be in, however they seem to be returned [ oldest, newest ]. if this order is important to you, then you should sort them just to be sure. (they didn't pinky promise, bestie π«Ά)
more details on the above example:
bugsβ this is used for bugs specified in"ids"parameter. it's a hash, wherein the keys are the numeric IDs of the bugs, and the corresponding value is an array ref of comment objects. note that any individual bug will only be returned once, so if you specify an ID multiple times in ID's, it will still only be returned once. (she said what she said, no duplicates β¨)commentsβ each individual comment requested in"comment_ids"is returned here. this is a hash wherein the keys are the numeric comment ID, and the corresponding value is the comment object.
a "comment" as described above is an object instance of this package i.e. BZ::Client::Bug::Comment. iykyk π
Errors
100- Invalid Bug Alias β if you specified an alias and there is no bug with that alias. π101- Invalid Bug ID β the"bug_id"you specified doesn't exist in the database.102- Access Denied β you do not have access to the"bug_id"you specified. rude, honestly.110- Comment Is Private β 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. (the vip lounge π)111- Invalid Comment ID β 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.
π§ add π§
this one lets you add a comment to a bug in Bugzilla. we love to see it π
the actual Bugzilla API method is "add_comment".
History
- 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.
Parameters
an instance of this package or a hash containing:
idβ id (int or string) Required β the ID or alias of the bug to append a comment to.commentβ 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. (so no empty vibes, bestie, she will notice πΈ)is_privateβ 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. (legacy queen π)work_timeβ 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. (ignored. literally just ignored. π)
Returns
the id of the newly-created comment. baby's first id π
Errors
54- Hours Worked Too Large β you specified a"work_time"larger than the maximum allowed value of99999.99.100- Invalid Bug Alias β if you specified an alias and there is no bug with that alias.101- Invalid Bug ID β the ID you specified doesn't exist in the database.109- Bug Edit Denied β you did not have the necessary rights to edit the bug.113- Can't Make Private Comments β you tried to add a private comment, but don't have the necessary rights.114- Comment Too Long β you tried to add a comment longer than the maximum allowed length (65,535characters).
π heads up: before Bugzilla 3.6, error54and error114had a generic error code of32000.
β render β
returns the HTML rendering of the provided comment text.
the actual Bugzilla API method is "render_comment".
β¨ Note: this all takes place on your Bugzilla server. not your machine, hers.
History
- Added in Bugzilla 5.0.
Parameters
textβ text (string) Required β text comment text to renderidβ id β the ID of the bug to render the comment against.
Returns
the HTML rendering
Errors
100- Invalid Bug Alias β if you specified an alias and there is no bug with that alias.101- Invalid Bug ID β the"bug_id"you specified doesn't exist in the database.102- Access Denied β you do not have access to the"bug_id"you specified.
π new π
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. (she's all talk until you call add, ngl π«Ά)
π INSTANCE METHODS π
this section lists the modules instance methods.
π bug_id π
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 πΈ
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. don't push it π
π¦ text π¦
synonym for "comment" β same girl, different name β¨
π is_private π
is_private (boolean) β if set to true, the comment is private, otherwise it is assumed to be public.
read and write. both! versatile icon π
π§ work_time π§
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.
max value is 99999.99
π id π
id (int) β the globally unique ID for the comment.
read only. hands off π₯
π attachment_id π
attachment_id (int) β if the comment was made on an attachment, this will be the ID of that attachment. otherwise it will be null.
read only.
added to the return value in Bugzilla 3.6
π«Ά count π«Ά
count (int) β the number of the comment local to the bug. the Description is 0, comments start with 1.
read only.
added to the return value in Bugzilla 4.4.
π₯ creator π₯
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) β so like, enjoy it while it lasts π
in bugzilla 4.0, the "author" return value was renamed to "creator".
π¦ author π¦
see creator β¬οΈ
β time β
time (DateTime) β the time (in Bugzilla's timezone) that the comment was added.
read only.
π creation_time π
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. (so like... maybe migrate, bestie π)
read only.
added in Bugzilla 4.4.
π SEE ALSO π
BZ::ClientBZ::Client::API- Bugzilla API <https://www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Bug.html>
π AUTHORS π
- Dean Hamstead
<dean@bytefoundry.com.au> - Jochen Wiedmann
<jochen.wiedmann@gmail.com>
π COPYRIGHT AND LICENSE π
this software is copyright (c) 2026 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. slay π β¨
and that's the whole page, bestie! this footer energy: perl v5.40.2, dated 2026-07-16 β that's the BZ::Cl...omment(3pm) manual page, signed, sealed, delivered π«ΆπΈ
π¦ where this page comes from
- epel 10: perl-BZ-Client 4.9100-2.el10_3 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms