1
我试图在状态设置为RESOLVED时修改分配给To字段上的错误(给Reporter)。我当前的代码如下所示:Bugzilla扩展:在bug_end_update中使用set_assigned_to修改“分配给”字段
sub bug_end_of_update
{
my ($self, $args) = @_;
my $bug = $args->{ 'bug' };
my $changes = $args->{ 'changes' };
# Check if the status has changed
if ($changes->{ 'bug_status' })
{
my ($old_status, $new_status) = @{ $changes->{ 'bug_status' } };
# Check if the bug status has been set to RESOLVED
if ($new_status eq "RESOLVED")
{
# Change Assignee to the original Reporter of the Bug.
$bug->set_assigned_to(<reporter obj>);
# Add to changes for tracking
$changes->{ 'assigned_to' } = [ <assigned obj>, <reporter obj> ];
}
}
}
我找两件事情:
1)在bug_end_of_update我怎么了记者的用户对象和分配给用户对象?
2)更改数组查找用户对象还是仅登录信息?
谢谢!
发现http://bugzilla.glob.com.au/irc/a=date&h=&s=+4+Feb+2011&e=+4+Feb+2011其对我需要做的改变做了一些深入的了解,以便全面掌握和运行。首先我使用了错误的Hook,因为在bug_end_of_update中DB已经被写入。所以我用object_end_of_set_all调整了参数和一切工作。用户对象只需登录信息$ bug-> reporter->登录。 – TimReeves 2012-03-14 04:25:03