Hi,
I am trying to create new task using php curl . I have trouble creating custom fields while creating the task . I am not sure how the format of the custom fields needs to be.
I am getting this phrase in the error “phrase”:“19 drunk urchins look hungrily”.
/* Example 1 */
$customFields = array(
3456 =>10800,
);
$cust = json_encode($customFields);
$fields = array(
‘notes’ => $notes,
‘name’ => $name,
‘projects’ => $pid,
‘custom_fields’ =>$cust,
);
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $url,
CURLOPT_POST => 1,
CURLOPT_POSTFIELDS => $fields,
));
curl_setopt($curl, CURLOPT_HTTPHEADER, array($header));
/* Example 2 */
I tried creating custom fields using this too
$customFields = array(array(
‘id’ =>3456,
‘name’=> ‘Cost’,
‘number_value’=>10500,
‘type’=>‘number’,
));
$cust = json_encode($customFields);
Please assist.
Thanks,
Kavitha.