当错误标记为“已解决”时,如何自动将错误的受让人改回报告者?

发布于 2024-09-10 06:36:22 字数 173 浏览 5 评论 0原文

我们有一个工作流程,其中所有传入的错误都被标记为已分配给其产品的默认受让人,然后它们保留在已分配状态,直到受让人解决为止。

此时,他们要么从“已解决”返回“已分配”(例如,尚未完成),要么在报告者满意后返回“已关闭”。

当第一个受让人将错误标记为“已解决”时,我们如何自动将错误的受让人更改为报告者?

We have a workflow where all incoming bugs are marked ASSIGNED to their product's default assignee, then they stay in ASSIGNED until RESOLVED by the assignee.

At that point, they go either from RESOLVED back to ASSIGNED (e.g. not done yet) or to CLOSED once they reporter is satisfied.

How do we automatically change the assignee of the bug to the reporter when the first assignee marks it RESOLVED?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

染火枫林 2024-09-17 06:36:22

实际上,使用 Bugzilla hooks 非常容易。扩展代码需要放在哪里取决于您使用的版本,因为这是一项正在快速发展的功能。

在当前版本 Bugzilla 3.6.1 中,如果您想调用扩展 Local,您需要创建一个文件 extensions/Local/Extension.pm

http://www.bugzilla.org/docs/ 3.6/en/html/api/Bugzilla/Extension.html是整个扩展系统的概述。

为此,您要使用的钩子是 bug_end_of_update,它在对象更改后但写入数据库之前在 Bugzilla/Bug.pm 中调用。

对于您正在做的事情,您可能应该检查 changes 以查看 bug_status 是否已更改。如果是这样,请更新 bug 以将所有者设置为报告者,并将该更改添加到 changes

Bugzilla 的主要开发人员通常可以在 irc.mozilla.org 上的#mozwebtools 上找到,如果我的回答不足以让您感兴趣,请顺便与他们讨论细节。

Actually, this is pretty easy with Bugzilla hooks. Where the extension code needs to go will depend on what version you are using, because this is a capability that's rapidly developing.

In Bugzilla 3.6.1, the current version, if you wanted to call your extension Local, you would create a file extensions/Local/Extension.pm.

http://www.bugzilla.org/docs/3.6/en/html/api/Bugzilla/Extension.html is the overview of the whole extension system.

The hook you want to use for this is bug_end_of_update, which is called in Bugzilla/Bug.pm after the object is changed but before it is written to the database.

For what you're doing, you should probably check changes to see whether bug_status has changed. If so, update bug to set the owner to the reporter, and add that change to changes.

The main developers of Bugzilla can usually be found on #mozwebtools on irc.mozilla.org, drop in and chat them up about the particulars if my answer isn't enough to get you rolling.

从此见与不见 2024-09-17 06:36:22

这将起作用:(CustomExtension.pm)

package Bugzilla::Extension::CustomExtension;
use strict;
use base qw(Bugzilla::Extension);

our $VERSION = '1.0';
use constant NAME => 'CustomExtension';

sub object_end_of_set_all {
    my ($self, $args) = @_;

    my $object = $args->{'object'};

    if ($object->isa('Bugzilla::Bug')) {
        if ($object->{'bug_status'} eq 'RESOLVED') {            # Bug has been RESOLVED
            $object->{'assigned_to'} = $object->{'reporter_id'};    # re-assign to Reporter
        }
    }
}

__PACKAGE__->NAME;

This will work: (CustomExtension.pm)

package Bugzilla::Extension::CustomExtension;
use strict;
use base qw(Bugzilla::Extension);

our $VERSION = '1.0';
use constant NAME => 'CustomExtension';

sub object_end_of_set_all {
    my ($self, $args) = @_;

    my $object = $args->{'object'};

    if ($object->isa('Bugzilla::Bug')) {
        if ($object->{'bug_status'} eq 'RESOLVED') {            # Bug has been RESOLVED
            $object->{'assigned_to'} = $object->{'reporter_id'};    # re-assign to Reporter
        }
    }
}

__PACKAGE__->NAME;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文