5.7.214. Bugzilla::Extension::RuleEngine::Rule

5.7.214.1. NAME

Bugzilla::Extension::RuleEngine::Rule - Bugzilla Rule class.

5.7.214.2. SYNOPSIS

use Bugzilla::Extension::RuleEngine::Rule;

my $rule = new Bugzilla::Extension::RuleEngine::Rule(1);
my $rule = new Bugzilla::Extension::RuleEngine::Rule({name => 'Acme'});

my $id                = $rule->id;
my $name              = $rule->name;
my $description       = $rule->description;
my $creation_ts       = $rule->creation_ts;
my $rule_group_id     = $rule->rule_group_id;
my $current_detail_id = $rule->current_detail_id;
my $last_used         = $rule->last_used;
my $use_count         = $rule->use_count;
my $sortkey           = $rule->sortkey;
my $is_periodic       = $rule->is_periodic;

5.7.214.3. DESCRIPTION

Bugzilla::Extension::RuleEngine::Rule represents a rule object. It is an implementation of Bugzilla::Object, and thus provides all methods that Bugzilla::Object provides.

The methods that are specific to Bugzilla::Extension::RuleEngine::Rule are listed below.

A Rule is a rule that is part of the Bugzilla Rules Engine. A rule is versioned with a specific version called a rule detail.

5.7.214.4. METHODS

  • current
  • Description
Returns the current version of the rule
  • Params
none.
  • Returns
A Bugzilla::Extension::RuleEngine::RuleDetail object.
  • all_details
  • Description
Returns all versions of the rule
  • Params
none.
  • Returns
An arrayref of Bugzilla::Extension::RuleEngine::RuleDetail objects.
  • match_rules
  • Description
Returns rules that meet a certain criteria
  • Params
  • inactive
If set, will return all rules. Otherwise will only return active rules or those changed in the last 7 days.
  • product
The name of the product. All products if not specified.
  • sort_order
The order to sort rows by. Possible values are: run, alpha, create, update, last or hits
  • reverse
Reverse the sort order above
  • rule_group_id
The id of the rule group to limit results to.
  • is_bug_change
only rules that fire on bug change
  • isactive
limit to active rules
  • is_periodic
limit to periodic rules
  • minor_update
Should changes made by this rule be marked as minor updates?
  • Returns
An arrayref of Bugzilla::Extension::RuleEngine::Rule objects.
  • run_after
  • Description
Returns the name of the rule that is run before this one
  • Params
none.
  • Returns
The name of the rule that is run before this one. Returns an empty string if this is the first rule.
  • set_active
  • Description
Changes the active state of the bug. This is done by creating a new rule detail row, and updating the current_detail_id value.
  • Params
is_active (boolean) - Whether this rule should be active or inactive.
  • Returns
The id of the newly create rule detail.

This documentation undoubtedly has bugs; if you find some, please file them here.