Also I am using Fog Creek's online FogBugz.
My code of creating the object is below.
my $fogbugz = WebService::FogBugz->new({
email => 'myemailaddress',
password => 'mypassword',
base_url => '
http://movabletype.fogbugz.com/api.asp'
});
I think that you use 'api.asp' instead 'default.asp' like below.
my $fogbugz = WebService::FogBugz->new({
email => 'myemailaddress',
password => 'mypassword',
base_url => '
https://method-r.fogbugz.com/api.asp'
});
$fogbugz->logon;
my $res = $fogbugz->request_method('search', {
q => 'FooBar',
});
print $res . "\n";
Basically WebService::FogBugz returns XML from 'request_method 'method.
If you want to get title of a case, following code will work fine.
#!/usr/bin/perl
use strict;
use warnings;
use WebService::FogBugz;
my $fogbugz = WebService::FogBugz->new({
email => 'myemailaddress',
password => 'mypassword',
base_url => '
http://movabletype.fogbugz.com/api.asp'
});
$fogbugz->logon;
# retrieve title of the case from
https://movabletype.fogbugz.com/default.asp?111350
my $res = $fogbugz->request_method('search', {
q => '111350',
cols => 'sTitle',
});
print $res . "\n"; # show plain XML
# get the title
use XML::LibXML;
my $parser = XML::LibXML->new;
my $dom = $parser->load_xml(string => $res);
my $doc = $dom->documentElement();
print Dumper($doc->findvalue('*[local-name()="cases"]')) . "\n";
You can see like following result in STDOUT.
<?xml version="1.0" encoding="UTF-8"?><response><cases count="1"><case ixBug="111350" operations="edit,assign,resolve,remind"><sTitle><![CDATA[FB: Tooltip can be garbage with static publishing]]></sTitle></case></cases></response>
$VAR1 = 'FB: Tooltip can be garbage with static publishing';
I hope this can help you.
Regards,
-- shigeta
On Fri Jan 17 13:43:46 2014, jeff.holt@method-r.com wrote:
Show quoted text> I modified the constructor as follows:
>
> 9 my $fogbugz = WebService::FogBugz->new({
> 10 email => 'myemailaddress',
> 11 password => 'mypassword',
> 12 base_url => '
https://method-r.fogbugz.com/default.asp'
> 13 });
>
> Please note, from the base url, that I am using fogcreek's online
> fogbugz
> service. I can imagine that their version is different than the one
> that
> you might install locally behind your firewall. But my hope is that
> they
> use the same version that you do. If that's not true, then you might
> want
> to either publish a caveat or work with fogcreek to make your code
> work
> with cookies, which is how they're doing authentication with their
> online
> service.
>
> It takes quite a while for your code to return the html file that I've
> attached. All it does it return the login html page code.
>
> Below is the shell script that I've been able to make work
> consistently.
>
> email='myemailaddress'
> password='mypassword'
> data="pre=preLogon&dest=&sPerson=$email&sPassword=$password&fRememberPassword=1"
> curl --cookie-jar kook.notjar --data "$data" "
>
https://method-r.fogbugz.com/default.asp" > login.html
> curl --cookie kook.notjar "
https://method-
> r.fogbugz.com/default.asp?89" >
> 89.html
>
> fogcreek published a web page that describes how to use their api.asp
> but
> it returns only xml structures. I didn't even try it to see if their
> instructions worked because I wanted a 'pretty' html report.
>
>
> On Fri, Jan 17, 2014 at 8:46 AM, Takatsugu Shigeta via RT <
> bug-WebService-FogBugz@rt.cpan.org> wrote:
>
> > <URL:
https://rt.cpan.org/Ticket/Display.html?id=91997 >
> >
> > Thank you for your report.
> >
> > I can logon FogBugz 8 successfully.
> > The version of FogBugz was below.
> > FogBugz Version 8.9.93.0H (DB 822, Build 0)
> >
> > Could you try to run following script?
> > Please edit email, password and endpoint in the script before
> > running.
> >
> >
http://cpansearch.perl.org/src/SHIGETA/WebService-FogBugz-
> > 0.0.4/example/requests.pl
> >
> > If you get any errors in stdout, would you paste it?
> >
> >
> > > Do you have any updates for this module that support version 8 of
> > Fogbugz?
> > I don't think any updates so far. If you have any suggestions, please
> > let
> > me know.
> >
> > Regards,
> >