How to add an attachment using JIRA::REST?
I can able to create the Jira ticket. But I am unable to attach the text file. please help on this matter.
Error message :
ERROR: @ JIRA::REST Error[415 - Unsupported Media Type]:
at copy_of_new-jira.pl line 56.
Perl script
#Mobules of script
use JIRA::REST;
use Data::Dumper;
use Devel::Trace;
use JSON;
# Iterate on issues
my $search = $jira->POST('/search', undef, {
jql => 'project = xxx AND issuetype = Bug AND status = Unassigned AND created >= -10m',
startAt => 0,
maxResults => 1,
fields => [ qw/summary status assignee/ ],
});
foreach my $issue (@{$search->{issues}}) {
print "Found issue $issue->{key}\n";
}
# Attach files using an utility method
my $filename = "/root/perl-script/image.txt";
# Attach files using an utility method
$jira->attach_files(xxx-56639, ($filename));
attach_filesmethod? - chorobause Encode;somewhere near the top of /usr/local/share/perl5/JIRA/REST.pm - choroba