I'm trying to create issue using jira rest api, here's my code:
$new_issue = array(
'fields' => array(
'project' => array('key' => "KEY"),
'summary' => $this->Summary,
'description' => $this->Description,
'issuetype' => array('name' => 'Bug')
)
);
$body = json_encode($new_issue);
self::$handle = curl_init();
curl_setopt(self::$handle, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt(self::$handle, CURLOPT_POSTFIELDS, $body);
curl_setopt_array(self::$handle, array(
CURLOPT_URL => "jiraUrl//rest/api/2/issue/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_MAXREDIRS => 10,
CURLOPT_HTTPHEADER => array("content-type:application/json"),
CURLOPT_HEADER => true,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_ENCODING => ''
CURLOPT_HTTPAUTH => CURLAUTH_BASIC,
CURLOPT_USERPWD => $username . ':' . $password
));
$response = curl_exec(self::$handle);
$error = curl_error(self::$handle);
I'm getting this error: {"errorMessages":["No content to map to Object due to end of input"]} any suggestions?