(async () => {
try {
const taskData = {
name: 'New Task Name',
description: 'New Task Description',
assignees: [183],
tags: ['new'],
status: 'Open',
priority: 3,
due_date: 1508369194377,
due_date_time: false,
time_estimate: 8640000,
start_date: 1567780450202,
start_date_time: false,
notify_all: true,
parent: null,
links_to: null,
check_required_custom_fields: true,
custom_fields: [
{
id: '0a52c486-5f05-403b-b4fd-c512ff05131c',
value: 23,
},
{
id: '03efda77-c7a0-42d3-8afd-fd546353c2f5',
value: 'Text field input',
},
],
};
const { body } = await clickup.lists.createTask(1234, taskData);
console.log(body);
} catch (error) {
if (error.response) {
console.log(error.response.body);
console.log(error.response.statusCode);
console.log(error.response.headers);
} else if (error.request) {
console.log(error.request);
} else {
console.log('Error', error.message);
}
console.log(error.options);
}
})();
(async () => {
try {
const { body } = await clickup.tasks.get('9hz');
console.log(body);
} catch (error) {
if (error.response) {
console.log(error.response.body);
console.log(error.response.statusCode);
console.log(error.response.headers);
} else if (error.request) {
console.log(error.request);
} else {
console.log('Error', error.message);
}
console.log(error.options);
}
})();