现在我有两个目标。
即perl -T C:\bugzilla\bugzilla\importxml.pl -v -v
下面的API可能会有帮助,但我不确定。
http://www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Bug.html#update
那么,实现这些目标的可能方法是什么呢?
正如我所想的,也许我应该在现有的bugzilla代码中使用这些API的方法,我的梦想是:
。
但我不确定,我是在想对还是错。我也不知道如何使用这些API的方法?
发布于 2012-04-26 20:19:01
email_in.pl脚本可以完成所要求的事情的类型。但是,您将需要创建一个具有进行更改的权限的用户,并且需要将数据转换为email_in.pl理解的表单。
http://www.bugzilla.org/docs/4.2/en/html/api/email_in.html
发布于 2014-04-25 06:52:28
我可以提出第一点:
下面是我修改的一个svn_bz_append.pl脚本(http://www.telegraphics.com.au/svn/svn_bz/trunk/)的摘录,用于更新svn上的bugzilla注释。注意,我的脚本运行在Bugzilla安装的同一台机器上,因为它使用Bugzilla目录中的模块。我已经为Bugzilla诉4.2.3做了这个工作。
为了提取下面的摘录,我省略了这个脚本中的很多内容:
use strict;
use warnings;
use Bugzilla;
use Bugzilla::Config;
use Bugzilla::Bug;
use Data::Dumper;..。创建/获取用户Ids和一些要处理的bug Ids.
例:
my $userid = 1;
my @bugs = ( 1, 2, 3 );
my $message = 'Say something here';..。现在循环查看bug ids并添加注释..。
foreach my $bugId (@bugs) {
my $user = new Bugzilla::User({ id => $userid})
|| ThrowUserError('invalid_username', { id => $userid}); #get the user from bugzilla
print STDERR 'user: '. Dumper($user); #pretty prints the user object
Bugzilla->set_user($user); #this authenticates the user so that you may perform actions on bugs that the user has permissions to.
my $bug = Bugzilla::Bug->check($bugId); #gets the bug
print STDERR 'bug: '. Dumper($bug); #pretty prints the bug object
$bug->add_comment($message); #adds a comment to the bug
$bug->update(); #updated the bug - don't forget to do this!}
请注意,Dumper函数只是使用优秀的数据::Dumper模块:http://perldoc.perl.org/Data/Dumper.html --除了调试之外,您不需要它们。
登录信息来自:How can I authenticate when using the Bugzilla Perl API in a script?
https://stackoverflow.com/questions/10336884
复制相似问题