How to filter webhook triggers from subtask updates

I have a webhook system that listens to changes on the due_on field in a certain project.
My system then sets the due date for the task’s subtasks. However, these due date updates subsequently trigger the webhook again.

My webhook is set to “resource_type: task”, but I’m not sure what I should change to prevent second level task updates to also trigger the webhook.

Thanks!

I don’t think there’s any filter you can set to avoid that. Are you already filtering the webhook to only changes in the due_on field?

Yes I am. But since that’s also the field that I’m changing on the subtasks, it doesn’t help me.

I’m curious about the “parent” field though. I was hoping I could possibly filter by some value of that field, but it looks like this is always Null

Yeah, you won’t be able to filter out the changes on the subtasks from the webhook; you’ll have to deal with those on your end. But it should be easy; see below…

Right - per the API docs, for some reason the parent field on a webhook is only populated for added/removed events, not changes:
image

However, what I would do is get the task object from the returned webhook and examine its parent property, because that will always be populated for a a subtask and will easily tell you that it’s a subtask and the gid of its parent task.

1 Like

That works a charm. Thanks Phil!

1 Like