Apologies if this has been answered before, but I wasn’t finding it and I’m stumped.
I’m updating our webhooks to call for more detailed event logs than the hook sends instead of calling for the item itself, e.g. getEventData instead of getTaskData. I don’t know if this is due to me making a silly mistake (which it generally is,) if it’s some kind of bug, or if it was designed like this on purpose:
I cannot get event calls to show the new value on changes to a task’s due date.
I’ve got no problem getting the new value on custom_field dates, this is just on the due date for the task. I haven’t tried on a project yet.
Hook Data
{
"resource": "task",
"target": *URL*,
"filters": [
{
"resource_type": "task",
"resource_subtype": "default_task",
"action": "changed",
"fields": [
"start_on",
"due_on",
"assignee",
"custom_fields",
"name",
"completed"
]
}
]
}
Event Call
async getEventData(target, sync){
let eai = eventAPI(),
opts = new Object;
if(sync){
opts.sync = sync;
}
opts.opt_fields="action,change,change.action,change.added_value"
+",change.field,change.new_value,change.new_value.number_value"
+",change.new_value.date_value,change.new_value.date_value.date,change.new_value.date_value.datetime"
+",change.removed_value,created_at"
+",parent,parent.name,resource,resource.name,type,user,user.name";
return await eai.getEvents(target, opts).then((res)=>{
return [res.data, res._response.sync];
}).catch((error)=>{
if(error.response&&error.response.text){
let obj = JSON.parse(error.response.text);
//console.log(obj);
if(obj.sync){
return this.reGetEventData(target, obj.sync);
}else{
files.errorLog("There was an issue getting event data", error);
return [false, null];
}
}else{
files.errorLog("There was an issue getting event data", error);
return [false, null];
}
});
}
Event for Changed Date-Type Custom Field
{
"parent": null,
"action": "changed",
"type": "task",
"created_at": "2025-02-07T21:08:43.044Z",
"resource": {
"gid": *GID*,
"name": "PC Assignment: Test - Test"
},
"user": {
"gid":*GID*,
"name": *USER*
},
"change": {
"field": "custom_fields",
"action": "changed",
"new_value": {
"gid": *GID*,
"date_value": {
"date": "2024-06-11",
"date_time": null
}
}
}
}
Event Changed Due Date
{
"parent": null,
"action": "changed",
"type": "task",
"created_at": "2025-02-07T21:09:52.298Z",
"change": {
"field": "due_on",
"action": "changed"
},
"resource": {
"gid": *GID*,
"name": "PC Assignment: Test - Test"
},
"user": {
"gid": *GID*,
"name": *USER*
}
}
Is there a way to get the value of the new due date from an event that I’ve missed; is this a bug that needs to be fixed; or do I just have to get the task/project to get due dates?
Any guidance would be greatly appreciated!