NAME

WebService::Bugzilla::Bug - Bugzilla Bug object and service

VERSION

version 0.001

SYNOPSIS

my $bug = $bz->bug->get(12345);
say $bug->summary;
say $bug->status, ' / ', $bug->resolution;

# Search
my $bugs = $bz->bug->search(product => 'Firefox', status => 'NEW');

# Create
my $new = $bz->bug->create(
    product   => 'TestProduct',
    component => 'General',
    summary   => 'Something is broken',
    version   => 'unspecified',
);
say 'Created bug ', $new->id;

# Update
$bug->update(status => 'RESOLVED', resolution => 'FIXED');

# History
my $history = $bug->history;

DESCRIPTION

Provides access to the Bugzilla Bug API. Bug objects expose many read-only attributes corresponding to Bugzilla bug fields; all are lazy and fetched on first access.

ATTRIBUTES

All attributes are read-only and lazy. Accessing any attribute on a stub object (one created with only an id) triggers a single API call that populates every field at once.

alias

Arrayref of bug aliases.

assigned_to

Login name of the assignee.

blocks

Arrayref of bug IDs that this bug blocks.

cc

Arrayref of login names on the CC list.

component

The component name.

creation_time

ISO 8601 datetime when the bug was filed.

depends_on

Arrayref of bug IDs that this bug depends on.

is_open

Boolean. Whether the bug is in an open state.

keywords

Arrayref of keyword strings.

last_change_time

ISO 8601 datetime of the most recent change.

op_sys

Operating system field.

platform

Hardware platform field.

priority

Priority level (e.g. P1, P2).

product

Product name.

reporter

Login name of the reporter.

resolution

Resolution string (e.g. FIXED, INVALID), or empty when unresolved.

severity

Severity level.

status

Current status string (e.g. NEW, ASSIGNED, RESOLVED).

summary

One-line summary of the bug.

target_milestone

Target milestone string.

url

URL associated with the bug.

version

Version string.

whiteboard

Status-whiteboard text.

METHODS

create

my $bug = $bz->bug->create(%params);

Create a new bug. See POST /rest/bug.

Returns a stub WebService::Bugzilla::Bug with the new id.

get

my $bug = $bz->bug->get($id);

Fetch a single bug by numeric ID. See GET /rest/bug/{id}.

Returns a WebService::Bugzilla::Bug object, or undef if not found.

history

my $entries = $bug->history;
my $entries = $bz->bug->history($id);

Retrieve the change history for a bug. See GET /rest/bug/{id}/history.

Returns an arrayref of WebService::Bugzilla::Bug::History objects.

possible_duplicates

my $dupes = $bug->possible_duplicates;
my $dupes = $bz->bug->possible_duplicates($id);

Retrieve bugs that may be duplicates.

Returns an arrayref of WebService::Bugzilla::Bug objects.

my $bugs = $bz->bug->search(%params);

Search for bugs matching the given criteria. See GET /rest/bug.

Returns an arrayref of WebService::Bugzilla::Bug objects.

update

my $updated = $bug->update(%params);
my $updated = $bz->bug->update($id, %params);

Update an existing bug. See PUT /rest/bug/{id}.

Can be called as an instance method (uses the object's ID) or with an explicit ID as the first argument.

Returns a WebService::Bugzilla::Bug with the updated data.

last_visit

my $visit = $bug->last_visit;

Convenience wrapper; returns the WebService::Bugzilla::BugUserLastVisit record for this bug.

update_visit

my $visit = $bug->update_visit;

Convenience wrapper; marks the current user's last visit on this bug as "now".

SEE ALSO

WebService::Bugzilla - main client

WebService::Bugzilla::Bug::History - history entry objects

WebService::Bugzilla::Bug::History::Change - individual field changes

WebService::Bugzilla::BugUserLastVisit - last-visit records

https://bmo.readthedocs.io/en/latest/api/core/v1/bug.html - Bugzilla Bug REST API

AUTHOR

Dean Hamstead <dean@fragfest.com.au>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2026 by Dean Hamstead.

This is free software, licensed under:

The MIT (X11) License