use strict; use warnings; use Term::ReadKey; use JSON; use Data::Dumper; my $user = "USERID"; print "Please supply password and press enter:\n"; ReadMode('noecho'); my $password = ReadLine(0); chomp $password; if ($password eq "") { print "No password supplied. Script will exit.\n"; exit 1; } my $input_cycle = "1231233"; my $response; $response = `curl -sS -u USERID:$password -X GET -H "X-Atlassian-Token: no-check" https://jira-test.mycompany.es/rest/zapi/latest/cycle?projectId=34234`; my $decoded_json; $decoded_json = decode_json($response); my $hr = $decoded_json->{234234}[0]; ... #$response = `curl -sS -u USERID:$password -X POST -H "X-Atlassian-Token: no-check" -H "Content-Type:multipart/form-data" -F "file=\@C:\\Users\\ABC\\Desktop\\Work\\evidence.png" https://jira-test.mycompany.es/rest/zapi/latest/attachment?entityId=${last}&entityType=SCHEDULE`; print $response;