Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
Just another Perl shrine
 
PerlMonks  

Re: JIRA::Client returning "RemoteIssue=HASH(******)"

by keszler (Priest)
on Dec 03, 2011 at 15:46 UTC ( #941544=note: print w/ replies, xml ) Need Help??


in reply to JIRA::Client returning "RemoteIssue=HASH(******)"

Try it this way:

#!/usr/bin/perl use strict; use warnings; use Data::Dumper; use LWP::UserAgent; use JIRA::Client; use SOAP::Lite; my $user = 'username'; my $pw = 'password'; my $filterID = '12345'; my $jira=JIRA::Client->new('http://example.com/jira',$user,$pw); $jira->set_filter_iterator('$filterID'); while (my $issue = $jira->next_issue()) { print Dumper($issue); }
If that doesn't clarify things for you, reply back here with the result.


Comment on Re: JIRA::Client returning "RemoteIssue=HASH(******)"
Download Code
Re^2: JIRA::Client returning "RemoteIssue=HASH(******)"
by perlPractioner (Novice) on Dec 03, 2011 at 16:33 UTC

    Worked like a charm! Much appreciated! I received back the following:

    $VAR1=bless( { 'priority' => '2', 'customFieldValues' => [ bless( { 'customfieldID' => 'cus +tomfield_12345', 'values' => ['John Smit +h'], 'key' => undef}, 'RemoteCustomFieldValue +' ), bless ...

    It seems as if I will have to identify the customfieldIDs that I'm interested in and get the corresponding values. Do you know of another way to accomplish this other than parsing the output for the customfieldID then obtaining the hash tag value for "values"? Thanks again.

      Each $issue returned by $jira->next_issue is a blessed object with its own methods for getting and setting information. The JIRA::Client documentation doesn't have a lot of detail, and the source isn't much better. Try:

      while (my $issue = $jira->next_issue()) { #print Dumper($issue); my $custom_fields_ref = $issue->get_custom_fields(); for my $cf_name (keys %{$custom_fields_ref}) { print ">>$cf_name<< = >>>$custom_fields_ref->{$cf_name}<<<\n"; } print 'Priority: ', $issue->priority, $/; # do as above for other fields at the same level as 'priority' => 2 }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://941544]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2014-04-19 01:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (475 votes), past polls