As I am new to Rest API's please excuse me, if I ask any silly question.
Below is my script for linking the issues in JIRA via REST API. It is not running properly, could not able to figure out where is the problem as it is not throwing any error also. please help me on this, where I am going wrong.
<?php $restAPIURL = 'http://Company.Name/jira/rest/api/2/'; $projectsURL = $restAPIURL."issueLink/"; function callJIRAAPI($username,$password,$url,$jdata) { $curl = curl_init(); curl_setopt($curl, CURLOPT_USERPWD, "$username:$password"); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($curl, CURLOPT_POSTFIELDS, $jdata); $issue_list = (curl_exec($curl)); curl_close($curl); return json_decode($issue_list,true);//print_r($arr[0]['issues']); } $data = array( 'type'=>'Relates', 'comment'=>"Testing linkissue Script" ); $data['inwardIssue'][]= array("key"=>"TEST-313"); $data['outwardIssue'][]= array("key"=>"TEST-314"); $jdata = json_encode($data); try { echo $projectList = "<option value='-1'>--List of Links for the project--</option>"; callJIRAAPI($username,$password,$projectsURL,$jdata); } catch (Exception $e) { echo 'Caught exception: ', $e->getMessage(), "\n"; } ?>