Hello, I’m having trouble creating a subitem via the API with the Date column automatically filed. The subitem is correctly created, and I have no problems with other columns, but the date column just will not update. It is left blank on every created subitem.
Any thoughts on what I’m doing wrong below?
I’m using PHP. Here is my code:
$query = ‘mutation ($myItemName: String!, $columnVals: JSON!) { create_subitem (parent_item_id:(redacted), item_name:$myItemName, column_values:$columnVals) { id, board { id } } }’;
$vars = [‘myItemName’ => ‘TestItem’,
‘columnVals’ => json_encode([
‘status’ => [‘label’ => ‘Done’],
‘Date’ => [‘date’ => ‘2021-01-02’]
])];
$data = @file_get_contents($apiUrl, false, stream_context_create([
‘http’ => [
‘method’ => ‘POST’,
‘header’ => $headers,
‘content’ => json_encode([‘query’ => $query, ‘variables’ => $vars]),
]
]));
$responseContent = json_decode($data, true);
echo json_encode($responseContent);