r66192 - in /trunk/libjira-client-perl: Changes META.yml README debian/changelog lib/JIRA/Client.pm
angelabad-guest at users.alioth.debian.org
angelabad-guest at users.alioth.debian.org
Fri Dec 24 15:18:50 UTC 2010
Author: angelabad-guest
Date: Fri Dec 24 15:18:42 2010
New Revision: 66192
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=66192
Log:
New upstream release
Modified:
trunk/libjira-client-perl/Changes
trunk/libjira-client-perl/META.yml
trunk/libjira-client-perl/README
trunk/libjira-client-perl/debian/changelog
trunk/libjira-client-perl/lib/JIRA/Client.pm
Modified: trunk/libjira-client-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjira-client-perl/Changes?rev=66192&op=diff
==============================================================================
--- trunk/libjira-client-perl/Changes (original)
+++ trunk/libjira-client-perl/Changes Fri Dec 24 15:18:42 2010
@@ -1,4 +1,10 @@
Revision history for JIRA-Client
+
+0.26 2010-12-21
+
+ Implements some magic to make it easier to specify Cascading
+ field values in the create_issue and update_issue
+ methods. This was suggested by Keith Hackworth.
0.25 2010-09-11
Modified: trunk/libjira-client-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjira-client-perl/META.yml?rev=66192&op=diff
==============================================================================
--- trunk/libjira-client-perl/META.yml (original)
+++ trunk/libjira-client-perl/META.yml Fri Dec 24 15:18:42 2010
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: JIRA-Client
-version: 0.25
+version: 0.26
abstract: An extended interface to JIRA's SOAP API.
author:
- Gustavo Chaves <gnustavo at cpan.org>
Modified: trunk/libjira-client-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjira-client-perl/README?rev=66192&op=diff
==============================================================================
--- trunk/libjira-client-perl/README (original)
+++ trunk/libjira-client-perl/README Fri Dec 24 15:18:42 2010
@@ -1,6 +1,6 @@
Name: JIRA-Client
What: A OO interface to JIRA's SOAP API.
-Version: 0.25
+Version: 0.26
Author: Gustavo Chaves <gnustavo at cpan.org>
JIRA is a proprietary bug tracking system from Atlassian
Modified: trunk/libjira-client-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjira-client-perl/debian/changelog?rev=66192&op=diff
==============================================================================
--- trunk/libjira-client-perl/debian/changelog (original)
+++ trunk/libjira-client-perl/debian/changelog Fri Dec 24 15:18:42 2010
@@ -1,3 +1,9 @@
+libjira-client-perl (0.26-1) unstable; urgency=low
+
+ * New upstream release
+
+ -- Angel Abad <angelabad at gmail.com> Fri, 24 Dec 2010 16:18:04 +0100
+
libjira-client-perl (0.25-1) unstable; urgency=low
* New upstream release
Modified: trunk/libjira-client-perl/lib/JIRA/Client.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjira-client-perl/lib/JIRA/Client.pm?rev=66192&op=diff
==============================================================================
--- trunk/libjira-client-perl/lib/JIRA/Client.pm (original)
+++ trunk/libjira-client-perl/lib/JIRA/Client.pm Fri Dec 24 15:18:42 2010
@@ -11,11 +11,11 @@
=head1 VERSION
-Version 0.25
-
-=cut
-
-our $VERSION = '0.25';
+Version 0.26
+
+=cut
+
+our $VERSION = '0.26';
=head1 SYNOPSIS
@@ -139,8 +139,8 @@
# me so far. Getting rid of the DESTROY method doesn't work either
# because it would trigger a call to AUTOLOAD which is unable to
# do it correctly. I think a call to logout is proper here to shut
- # down the SOAP connection cleanly, but it doesn't seems to hurt
- # to not call it.
+ # down the SOAP connection cleanly, but it doesn't seem to hurt
+ # not to call it.
# shift->logout();
}
@@ -266,13 +266,39 @@
unless ref $custom_fields && ref $custom_fields eq 'HASH';
my %id2values;
while (my ($id, $values) = each %$custom_fields) {
- unless ($id =~ /^customfield_\d+$/) {
+ my $realid = $id;
+ unless ($realid =~ /^customfield_\d+$/) {
my $cfs = $self->get_custom_fields();
croak "Can't find custom field named '$id'.\n"
unless exists $cfs->{$id};
- $id = $cfs->{$id}{id};
- }
- $id2values{$id} = ref $values ? $values : [$values];
+ $realid = $cfs->{$id}{id};
+ }
+
+ # Custom field values must be specified as ARRAYs but we allow for some short-cuts.
+ if (! ref $values) {
+ $id2values{$realid} = [$values];
+ } elsif (ref $values eq 'ARRAY') {
+ $id2values{$realid} = $values;
+ } elsif (ref $values eq 'HASH') {
+ # This is a short-cut for a Cascading select field, which
+ # must be specified like this: http://tinyurl.com/2bmthoa
+ # The short-cut requires a HASH where each cascading level
+ # is indexed by its level number, starting at zero.
+ foreach my $level (sort {$a <=> $b} keys %$values) {
+ my $level_values = $values->{$level};
+ $level_values = [$level_values] unless ref $level_values;
+ if ($level eq '0') {
+ # The first level doesn't have a colon
+ $id2values{$realid} = $level_values
+ } elsif ($level =~ /^\d+$/) {
+ $id2values{"$realid:$level"} = $level_values;
+ } else {
+ croak "Invalid cascading field values level spec ($level). It must be a natural number.\n";
+ }
+ }
+ } else {
+ croak "Custom field '$id' got a '", ref($values), "' reference as a value.\nValues can only be specified as scalars, ARRAYs, or HASHes though.\n";
+ }
}
$hash->{custom_fields} = \%id2values;
return;
@@ -323,6 +349,29 @@
the format B<customfield_NNNNN>) or by its name, in which case the
method will try to convert it to its id. Note that to do that
conversion the user needs administrator rights.
+
+A simple custom field value can be specified by a scalar, which will
+be properly placed inside an ARRAY in order to satisfy the
+B<RemoteFieldValue>'s structure.
+
+Cascading select fields are properly specified like this:
+http://tinyurl.com/2bmthoa. The magic short-cut requires a HASH where
+each cascading level is indexed by its level number, starting at
+zero. So, instead of specifying it like this:
+
+ {
+ id => 'customfield_10011',
+ values => [ SOAP::Data->type(string => '10031' ) ]
+ },
+ {
+ id => 'customfield_10011:1',
+ values => [ SOAP::Data->type(string => '10188') ],
+ },
+
+You can do it like this:
+
+ {customfield_10011 => {'0' => 10031, '1' => 10188}},
+
=cut
More information about the Pkg-perl-cvs-commits
mailing list