I am not sure what happened recently. My Curl Request written in PHP to get Linked issues in a JIRA story is not getting the entire field rather than the first object. Meaning, If there are more than one Linked issues, the CURL request returns only the first linked issue details and none following it.
I know my code worked completely fine last month but suddenly starting last week, seeing this kind of issue.
If I use the API URL, https://track-api.[my-company].com/jira/rest/api/2/issue/[Issue-ID]?fields=issuelinks , I am able to see all the linked issues. While using the same in CURL request is not working fine.
I see this issue of first object being returned only with 'issueLinks' field and all other fields are getting returned completely fine with right values.
Is this an existing issue by any chance or something happening to me alone?
Here is my code to fetch issue details:
public static function getIssueDetails($id){
try {
$url="https://track-api.[my-company].com/jira/rest/api/2/issue/$id";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
// Set key and cert
curl_setopt($ch, CURLOPT_SSLCERT, self::$certFile);
curl_setopt($ch, CURLOPT_SSLKEY, self::$keyFile);
// execute!
$result = curl_exec($ch);
if (curl_errno($ch)) {
throw new Exception(curl_error($ch));
}
curl_close($ch);
return Array(
'status' => true,
'data' => json_decode($result,true),
);
} catch(Exception $ex) {
return Array(
'status' => false,
'data' => $ex->getMessage(),
);
}
}
}