How can I authenticate when using the Bugzilla Perl API in a script?

Posted by Allan Anderson on Stack Overflow See other posts from Stack Overflow or by Allan Anderson
Published on 2010-05-04T22:49:19Z Indexed on 2010/05/05 1:38 UTC
Read the original article Hit count: 306

Filed under:
|
|

Working from the Bugzilla API, I've written a quick Perl script to clone a Bugzilla Product (recreating all the Components under their new Product). The Bugzilla Perl API is quite easy to use from the command line. I could have just worked on the database directly, but I wanted a longer-term solution. Another option was the webservice, but I thought I'd try using the API directly this time.

The one problem I'm running into is authenticating as my Bz admin user so I can create the new components. Looking at Bugzilla's Bugzilla.pm file, I see that they just run login() from a Bugzilla::Auth object. I'm not sure how to get the username and password in there. I suppose I could just add the script to the Bugzilla admin interface...

Can any of you point me in the right direction?

© Stack Overflow or respective owner

Related posts about bugzilla

Related posts about perl