Code:
use REST::Client;
use JSON qw//;
use MIME::Base64;
use Data::Dumper;
use LWP::UserAgent;
use JIRA::Client;
`export PERL_LWP_SSL_VERIFY_HOSTNAME=0`;
my $ua = LWP::UserAgent->new(
ssl_opts => { verify_hostname => 0 },
protocols_allowed => ['https'],
);
my $username = 'saravanan.subramanian@cmegroup.com';
my $password = 'AXXX';
my $base_url = 'https://cmegroup-sandbox-461.atlassian.net';
#my $jira_rest = JIRA::Client::Automated->new('https://cmegroup-sandbox-461.atlassian.net', $user, $passwd);
my $jira_rest = REST::Client->new();
$jira_rest->addHeader('Content-Type','application/json');
$jira_rest->addHeader('Authorization','Basic'.encode_base64("$username:$password"));
$jira_rest->GET('https://cmegroup-sandbox-461.atlassian.net/rest/api/3/search?jql=project=vmt');
print Dumper($jira_rest);
print $jira_rest->responseCode();
'
I get 400 error when i am rying to run the code below. How ever the I have access to project
when i removed the single quotes in the link below I am able to see the results returned in the UI. Please let me know how to fix it
Error:
_rc' => '400', '_content' => '{"errorMessages":["The value \'vmt\' does not exist for the field \'project\'."],"warningMessages":[]}', '_msg' => 'Bad Request', '_protocol' => 'HTTP/1.1', '_request' => bless( { '_uri' => bless( do{\(my $o = 'https://cmegroup-sandbox-461.atlassian.net/rest/api/3/search?jql=project=vmt')}, 'URI::https' ), '_headers' => bless( {
URL
https://cmegroup-sandbox-461.atlassian.net/rest/api/3/search?jql=project=vmt'