r45346 - in /trunk/libjira-client-perl: Changes META.yml README TODO debian/changelog lib/JIRA/Client.pm

angelabad-guest at users.alioth.debian.org angelabad-guest at users.alioth.debian.org
Sun Oct 4 13:40:55 UTC 2009


Author: angelabad-guest
Date: Sun Oct  4 13:40:50 2009
New Revision: 45346

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=45346
Log:
New upstream 0.15

Modified:
    trunk/libjira-client-perl/Changes
    trunk/libjira-client-perl/META.yml
    trunk/libjira-client-perl/README
    trunk/libjira-client-perl/TODO
    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=45346&op=diff
==============================================================================
--- trunk/libjira-client-perl/Changes (original)
+++ trunk/libjira-client-perl/Changes Sun Oct  4 13:40:50 2009
@@ -1,4 +1,12 @@
 Revision history for JIRA-Client
+
+0.15	2009-09-28
+
+	The method progress_workflow_action_safely hash argument now
+	accepts the same shortcuts as the create_issue argument does.
+
+	Nate Murray and Jon Connell sent me bug reports and
+	suggestions. Thanks.
 
 0.14	2009-09-12
 

Modified: trunk/libjira-client-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjira-client-perl/META.yml?rev=45346&op=diff
==============================================================================
--- trunk/libjira-client-perl/META.yml (original)
+++ trunk/libjira-client-perl/META.yml Sun Oct  4 13:40:50 2009
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:                JIRA-Client
-version:             0.14
+version:             0.15
 abstract:            An extended interface to JIRA's SOAP API.
 license:             ~
 author:              

Modified: trunk/libjira-client-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjira-client-perl/README?rev=45346&op=diff
==============================================================================
--- trunk/libjira-client-perl/README (original)
+++ trunk/libjira-client-perl/README Sun Oct  4 13:40:50 2009
@@ -1,6 +1,6 @@
 Name:    JIRA-Client
 What:    A OO interface to JIRA's SOAP API.
-Version: 0.14
+Version: 0.15
 Author:  Gustavo Chaves <gnustavo at cpan.org>
 
 JIRA is a proprietary bug tracking system from Atlassian

Modified: trunk/libjira-client-perl/TODO
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjira-client-perl/TODO?rev=45346&op=diff
==============================================================================
--- trunk/libjira-client-perl/TODO (original)
+++ trunk/libjira-client-perl/TODO Sun Oct  4 13:40:50 2009
@@ -1,2 +1,7 @@
 - Implement some non-API methods from
   http://code.google.com/p/jira4r/source/browse/trunk/lib/jira4r/jira_tool.rb.
+
+- Implement a CLI tool like
+  http://confluence.atlassian.com/display/JIRAEXT/JIRA+Command+Line+Interface
+  or http://confluence.atlassian.com/display/JIRAEXT/JIRA+CLI as a
+  proof-of-concept usage example.

Modified: trunk/libjira-client-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjira-client-perl/debian/changelog?rev=45346&op=diff
==============================================================================
--- trunk/libjira-client-perl/debian/changelog (original)
+++ trunk/libjira-client-perl/debian/changelog Sun Oct  4 13:40:50 2009
@@ -1,3 +1,9 @@
+libjira-client-perl (0.15-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Angel Abad (Ikusnet SLL) <angel at grupoikusnet.com>  Sun, 04 Oct 2009 15:36:53 +0200
+
 libjira-client-perl (0.14-1) unstable; urgency=low
 
   * Initial Release. (Closes: #548162)

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=45346&op=diff
==============================================================================
--- trunk/libjira-client-perl/lib/JIRA/Client.pm (original)
+++ trunk/libjira-client-perl/lib/JIRA/Client.pm Sun Oct  4 13:40:50 2009
@@ -11,11 +11,11 @@
 
 =head1 VERSION
 
-Version 0.14
-
-=cut
-
-our $VERSION = '0.14';
+Version 0.15
+
+=cut
+
+our $VERSION = '0.15';
 
 =head1 SYNOPSIS
 
@@ -270,7 +270,7 @@
 		    unless exists $cfs->{$id};
 		$id = $cfs->{$id}{id};
 	    }
-	    $values = [$values]  unless ref $values;
+	    $values = [$values] unless ref $values;
 	    push @cfvs, bless({
 		customfieldId => $id,
 		key => undef,
@@ -519,8 +519,9 @@
 
 =item C<ACTION> can be either an action I<id> or an action I<name>.
 
-=item C<PARAMS> can be either an array of RemoteFieldValue objects or
-a hash mapping field names to field values.
+=item C<PARAMS> must be a hash mapping field names to field
+values. This hash accepts the same shortcuts as the argument to
+B<create_issue>.
 
 =back
 
@@ -545,26 +546,33 @@
 	$issue = $key;
 	$key   = $issue->{key};
     }
+    my ($project) = (split /-/, $key)[0];
     $params = {} unless defined $params;
     ref $params and ref $params eq 'HASH'
 	or croak "progress_workflow_action_safely's third arg must be a HASH-ref\n";
 
     # Grok the action id if it's not a number
     if ($action =~ /\D/) {
-	foreach my $aa (@{$self->getAvailableActions($key)}) {
-	    if ($aa->{name} eq $action) {
-		$action = $aa->{id};
-		last;
-	    }
-	}
-	croak "Unavailable action ($action).\n"
-	    if $action =~ /\D/;
+	my @available_actions = @{$self->getAvailableActions($key)};
+	my @named_actions     = grep {$action eq $_->{name}} @available_actions;
+	if (@named_actions) {
+	    $action = $named_actions[0]->{id};
+	}
+	else {
+	    croak "Unavailable action ($action).\n";
+	}
     }
 
     # Make sure $params contains all the fields that are present in
     # the action screen.
-    foreach my $id (map {$_->{id}} @{$self->getFieldsForAction($key, $action)}) {
+    my @fields = @{$self->getFieldsForAction($key, $action)};
+    foreach my $id (map {$_->{id}} @fields) {
+	# This is due to a bug in JIRA
+	# http://jira.atlassian.com/browse/JRA-12300
+	$id = 'affectsVersions' if $id eq 'versions';
+
 	next if exists $params->{$id};
+
 	$issue = $self->getIssue($key) unless defined $issue;
 	if (exists $issue->{$id}) {
 	    $params->{$id} = $issue->{$id} if defined $issue->{$id};
@@ -577,8 +585,77 @@
 		}
 	    }
 	    # NOTE: It's not a problem if we can't find a missing
-	    # parameter in the issue. It will simple stay
-	    # undefined.
+	    # parameter in the issue. It will simply stay undefined.
+	}
+    }
+
+    # Convert priority names
+    if (exists $params->{priority} && $params->{priority} =~ /\D/) {
+	my $prio  = $params->{priority};
+	my $prios = $self->get_priorities();
+
+	croak "There is no priority called '$prio'.\n"
+	    unless exists $prios->{$prio};
+	$params->{priority} = $prios->{$prio}{id};
+    }
+
+    # Convert component names
+    if (exists $params->{components}) {
+	croak "The 'components' value must be an ARRAY ref.\n"
+	    unless ref $params->{components} && ref $params->{components} eq 'ARRAY';
+	foreach my $c (@{$params->{components}}) {
+	    if (ref $c) {
+		die "Unexpected object in components list (", ref($c), ")\n"
+		    unless ref $c eq 'RemoteComponent';
+		$c = $c->{id};
+	    }
+	    elsif ($c =~ /\D/) {
+		# It is a component name. Let us convert it into its id.
+		my $components = $self->get_components($project);
+		croak "There is no component called '$c'.\n" unless exists $components->{$c};
+		$c = $components->{$c}{id};
+	    }
+	}
+    }
+
+    # Convert version ids and names into RemoteVersion objects
+    for my $versions (qw/fixVersions affectsVersions/) {
+	if (exists $params->{$versions}) {
+	    croak "The '$versions' value must be a ARRAY ref.\n"
+		unless ref $params->{$versions} && ref $params->{$versions} eq 'ARRAY';
+	    foreach my $v (@{$params->{$versions}}) {
+		if (ref $v) {
+		    die "Unexpected object in version list (", ref($v), ")\n"
+			unless ref $v eq 'RemoteVersion';
+		    $v = $v->{id};
+		}
+		elsif ($v =~ /\D/) {
+		    # It is a version name. Let us convert it into its id.
+		    my $versions = $self->get_versions($project);
+		    croak "There is no version called '$v'.\n" unless exists $versions->{$v};
+		    $v = $versions->{$v}{id};
+		}
+	    }
+	}
+    }
+    if (exists $params->{affectsVersions}) {
+	# This is due to a bug in JIRA
+	# http://jira.atlassian.com/browse/JRA-12300
+	$params->{versions} = delete $params->{affectsVersions};
+    }
+
+    # Convert custom fields
+    if (my $custom_fields = delete $params->{custom_fields}) {
+	croak "The 'custom_fields' value must be a HASH ref.\n"
+	    unless ref $custom_fields && ref $custom_fields eq 'HASH';
+	while (my ($id, $values) = each %$custom_fields) {
+	    unless ($id =~ /^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};
+	    }
+	    $params->{$id} = [$values] unless ref $values;
 	}
     }
 
@@ -618,8 +695,12 @@
 
 sub new {
     my ($class, $id, $values) = @_;
-    $id     = 'versions' if     $id eq 'affectsVersions';
-    $values = [$values]  unless ref $values;
+
+    # This is due to a bug in JIRA
+    # http://jira.atlassian.com/browse/JRA-12300
+    $id = 'versions' if $id eq 'affectsVersions';
+
+    $values = [$values] unless ref $values;
     bless({id => $id, values => $values}, $class);
 }
 




More information about the Pkg-perl-cvs-commits mailing list