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