Skip to content

Commit e0d898d

Browse files
author
David Lawrence
committed
Bug 1033258 - bzexport fails to leave a comment when attaching a file using the BzAPI compatibility layer
1 parent 48577f2 commit e0d898d

File tree

1 file changed

+8
-1
lines changed
  • extensions/BzAPI/lib/Resources

1 file changed

+8
-1
lines changed

extensions/BzAPI/lib/Resources/Bug.pm

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,12 @@ sub add_attachment_request {
587587
}
588588
}
589589
}
590+
591+
# Add comment if one is provided
592+
if (exists $params->{comments} && scalar @{ $params->{comments} }) {
593+
$params->{comment} = $params->{comments}->[0]->{text};
594+
delete $params->{comments};
595+
}
590596
}
591597

592598
sub update_attachment_request {
@@ -613,8 +619,9 @@ sub update_attachment_request {
613619
}
614620
}
615621
}
622+
616623
# Add comment if one is provided
617-
if ($params->{comments}) {
624+
if (exists $params->{comments} && scalar @{ $params->{comments} }) {
618625
$params->{comment} = $params->{comments}->[0]->{text};
619626
delete $params->{comments};
620627
}

0 commit comments

Comments
 (0)