Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the JIRA-Client CPAN distribution.

Report information
The Basics
Id: 68042
Status: resolved
Priority: 0/
Queue: JIRA-Client

People
Owner: GNUSTAVO [...] cpan.org
Requestors: njh [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.27
Fixed in: (no value)



Subject: Please pass additional arguments to new() on to SOAP::Lite
Hello, First of all, thank you very much for publishing JIRA::Client, it has made my life a lot easier :-) In my organisation we are behind an HTTP firewall. It would be very helpful if additional arguments passed to JIRA::Client->new() were passed on to SOAP::Lite. For example: my $jira = JIRA::Client->new( 'http://jira.myorg.co.uk', 'nicholas.humfrey', 'adfadgadfg', proxy => ['http' => 'http://www-cache.myorg.co.uk/'] ); It would also be handy if this was mentioned in the documentation. This is the modification that I have applied to my copy of JIRA/Client.pm: sub new { my ($class, $base_url, $user, $pass, %args) = @_; my $soap = SOAP::Lite->proxy("$base_url/rpc/soap/jirasoapservice-v2?wsdl", %args); Thanks, nick.
Subject: Re: [rt.cpan.org #68042] Please pass additional arguments to new() on to SOAP::Lite
Date: Mon, 9 May 2011 20:40:32 -0300
To: bug-JIRA-Client [...] rt.cpan.org
From: Gustavo Leite de Mendonça Chaves <gnustavo [...] cpan.org>
2011/5/9 Nicholas J Humfrey via RT <bug-JIRA-Client@rt.cpan.org> Show quoted text
> > Hello, > > First of all, thank you very much for publishing JIRA::Client, it has made > my life a lot easier :-) >
Thank you. Show quoted text
> > In my organisation we are behind an HTTP firewall. It would be very helpful > if additional > arguments passed to JIRA::Client->new() were passed on to SOAP::Lite. For > example: > > my $jira = JIRA::Client->new( > 'http://jira.myorg.co.uk', > 'nicholas.humfrey', 'adfadgadfg', > proxy => ['http' => 'http://www-cache.myorg.co.uk/'] > ); > > It would also be handy if this was mentioned in the documentation.
Good idea. I just released version 0.28 which incorporates that. It should appear shortly at CPAN. Please, give it a try and tell me what you think. Gustavo.
Idea incorporated in version 0.28.
From: jimsearle [...] gmail.com
On Mon May 09 19:41:53 2011, GNUSTAVO wrote: Show quoted text
> Idea incorporated in version 0.28.
This does not seem to work with on_fault? I tried my $jira = JIRA::Client->new('http://jira.....com', $user, $passwd, on_fault => \&handleFault, ); my $badIssue = $jira->getIssue("BLAH"); warn "badIssue=$badIssue\n"; Which just returns: soapenv:Server.userException, com.atlassian.jira.rpc.exception.RemotePermissionException: This issue does not exist or you don't have permission to view it. at ... line 32 so my script dies, but I want it to continue. a quick test added to Client.pm: my $soap = SOAP::Lite->proxy("$base_url/rpc/soap/jirasoapservice-v2? wsdl", @args); # Temporary workaround for passing on on fault as first extra arg $soap->on_fault($args[1]) if ($args[0] eq "on_fault"); now I get control back: --> handleFault SOAP FAULT: [soapenv:Server.userException] com.atlassian.jira.rpc.exception.RemotePermissionException: This issue does not exist or you don't have permission to view it. badIssue=
Subject: Re: [rt.cpan.org #68042] Please pass additional arguments to new() on to SOAP::Lite
Date: Fri, 23 Sep 2011 22:57:10 -0300
To: bug-JIRA-Client [...] rt.cpan.org
From: Gustavo Leite de Mendonça Chaves <gnustavo [...] cpan.org>
2011/9/21 Jim Searle via RT <bug-JIRA-Client@rt.cpan.org> Show quoted text
> > This does not seem to work with on_fault? I tried > my $jira = JIRA::Client->new('http://jira.....com', > $user, $passwd, > on_fault => \&handleFault, > ); > my $badIssue = $jira->getIssue("BLAH"); > warn "badIssue=$badIssue\n"; >
I didn't know about this 'on_fault' option. In fact, I couldn't find it in the SOAP::Lite documentation. I found about the on_fault method, but are you sure this option can be meaningfully passed to the SOAP::Lite->proxy method? In fact, all JIRA methods fail by throwing exceptions. I'm going to document this in the next release with this text in the beginning of the POD: All methods fail by throwing exceptions (croaking, actually). You may want to guard against this by invoking them within an eval block, like this: my $issue = eval { $jira->getIssue('TST-123') }; die "Can't getIssue('TST-123'): $@" if $@; What do you think? -- Gustavo.