哪个 Perl 模块用于在 Bugzilla 4.0.1 上创建/更新错误?

发布于 2024-11-13 08:19:25 字数 535 浏览 4 评论 0原文

我有大量来自 Jira 和 Github 的错误,我想将它们转移到 Bugzilla。我可以通过 Net::Github API 通过 xml 和 Github 轻松获取 Jira bug。问题在于在 Bugzilla 上创建错误。我的登录信息 100% 正确,但错误不会提交。

我正在使用 http://search.cpan 中找到的模块.org/~bmc/WWW-Bugzilla-1.5/WWW/Bugzilla.pm

我注意到还有一些其他的 Bugzilla 模块,例如 WWW::Bugzilla3,我认为它是 Bugzilla 的 3.0.0 版本。我是否在 Bugzilla 4.0.1 中使用了错误的版本?

如果我只是使用服务器、电子邮件和密码创建一个 Bugzilla 对象,该对象似乎可以正确登录,但之后无法获取任何产品、组件或版本。

编辑:我决定尝试 Bugzilla3 模块并且它有效。

I have a large amount of bugs from Jira and Github that I want to transfer to Bugzilla. I can easily get the Jira bugs via xml and Github through the Net::Github API. The issue is with creating the bugs on Bugzilla. I have the login information 100% correct, but the bugs won't commit.

I am using the module found at http://search.cpan.org/~bmc/WWW-Bugzilla-1.5/WWW/Bugzilla.pm

I've noticed there are some other Bugzilla modules such as WWW::Bugzilla3 which I assume is version 3.0.0 of Bugzilla. Am I using the wrong one for Bugzilla 4.0.1?

If I simply create a Bugzilla object with just the server, email, and password, the object appears to be logging in correctly, but it can't get any of the products, components, or versions afterwards.

EDIT: I decided to try the Bugzilla3 module and it worked.

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

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

发布评论

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

评论(2

撩人痒 2024-11-20 08:19:25

解决方案是使用 Bugzilla3 模块,但并非它的所有功能都可以 100% 与 Bugzilla 4.0.1 配合使用...它也缺乏更新已提交错误的能力,因此我们只是将所有错误移至新组件,删除了该组件组件,并再次运行脚本进行补偿。

Solution was to use the Bugzilla3 module, but not all of its features work 100% with Bugzilla 4.0.1... It also lacks the ability to update submitted bugs, so we just moved all of the bugs to a new component, deleted that component, and ran the script again to compensate.

一绘本一梦想 2024-11-20 08:19:25

我已经回答了一些可能对另一个问题有帮助的问题:如何在现有 bugzilla 代码中使用 bugzilla API? 对于我发现的 Google 群组:https://groups.google.com/forum/#!topic/mozilla.support.bugzilla/7KEs5HqUtgo

两个来源都是关于更新现有错误,但我发现如果您查看 Bugzilla 源代码的 bug.pm 文件,您应该能够找到一些如何创建新错误的示例 - 我可以看到您在更新时遇到问题,但能够创建错误使用 BZ3 模块。


以下是 svn_bz_append.pl 脚本的摘录 (http://www.telegraphics.com .au/svn/svn_bz/trunk/),我已经修改了它,我用它来更新 svn 提交上的 bugzilla 注释。请注意,我将此脚本与 Bugzilla 安装在同一台计算机上运行,​​因为它使用 Bugzilla 目录中的模块。我已经在 Bugzilla v 4.2.3 上工作了。

我省略了这个脚本的大部分内容,摘录如下:

use strict;
use warnings;

use Bugzilla;
use Bugzilla::Config;
use Bugzilla::Bug;

use Data::Dumper;

... 创建/获取用户 ID 和一些要处理的 bug Id ...

例如:

my $userid = 1;
my @bugs = ( 1, 2, 3 );
my $message = 'Say something here';

... 现在循环 bug id 并添加注释...

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 函数仅使用优秀的 Data::Dumper 模块: http: //perldoc.perl.org/Data/Dumper.html - 除了调试之外,您不需要它们。

登录信息来自: 在脚本中使用 Bugzilla Perl API 时如何进行身份验证?

I've answered something that may be helpful for another SO question: How to use bugzilla API in existing bugzilla code? AND for a google groups one that I found: https://groups.google.com/forum/#!topic/mozilla.support.bugzilla/7KEs5HqUtgo

Both sources are about UPDATING an existing bug, but I found if you look through the bug.pm file of the Bugzilla source, you should be able to find some examples of how to create a new bug - I can see that you had problems with UPDATING, but were able to create the bugs using the BZ3 module.


Here's an excerpt from a a svn_bz_append.pl script (http://www.telegraphics.com.au/svn/svn_bz/trunk/) that I've modified that I use to update bugzilla comments on svn commits. Note that I have this script running on the same machine as the Bugzilla install, as it uses modules from within the Bugzilla directory. I have this working for Bugzilla v 4.2.3.

I've omitted quite a bit of this script to pull out the excerpt below:

use strict;
use warnings;

use Bugzilla;
use Bugzilla::Config;
use Bugzilla::Bug;

use Data::Dumper;

... create/fetch the userid and some bug Ids to work on ...

eg:

my $userid = 1;
my @bugs = ( 1, 2, 3 );
my $message = 'Say something here';

... now loop through the bug ids and add the comment...

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!
}

Please note that the Dumper functions are just using the excellent Data::Dumper module: http://perldoc.perl.org/Data/Dumper.html - you don't need them except for debugging.

The log in info came from: How can I authenticate when using the Bugzilla Perl API in a script?

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