Thank you @Phil_Seeman for the quick reply.
This was not completely clear as I continuously got the message “Webhooks for larger scoped resources must have at least one filter and all filters must be in our whitelist.”
This will work perfectly for our purpose though.
Even on the task level however, I still am not able to get the filter working. The webhook is created successfully, but there is no filter in the response. Also the webhook is called on other events except the completed_at field.
“filters”: [
{
“resource_type”: “task”,
“resource_subtype”: “deafult_task”,
“action”: “changed”,
“fields”: [
“completed_at”
]
}
]
Yes, sure. The webhook is created, and gets called on updates successfully. But it gets called on every event and so the filter is not applied:
I want to only get notified when the task gets completed.
When I try the following in postman:
{
“data”: {
“resource”: “12936891283649”, #task_id (not a real one)
“target”: “https://mydomain/asana-workspace-webhook/”,
“filters”: [
{
“resource_type”: “task”,
“resource_subtype”: “default_task”,
“action”: “changed”,
“fields”: [
“completed_at”
]
}
]
}
}
Actually, it seems to work now. It’s just not passing the filter in the response. Not either when getting the webhook by id at webhooks endpoint.
I was getting other updates from a different larger scope webhook.
@Ross_Grambo or @Joe_Trollo, is that a bug that it’s not echoing back the filter? It does show in the documentation that the filter should be part of the returned data.
Yes, prior to 100% rollout (which only occurred last week) this field was only available by selecting it with opt_fields. In the next day or so it should be included by default in responses.
Is there a way to create a webhook that is filtered by changes to a specific custom field instead of a change to any custom field? Also, is there a list of all the possible fields a webhook can filter various resources by? Thanks!
All of the improvements mentioned in this thread (larger scopes, new events, filtering) have been released, are available, and are documented in the API documentation.
Ask here in the forum (probably best to start a new topic) if you have questions! EDIT: Oh, I just saw you already did exactly that!
Hello, I am trying to create a Webhook that fires when the task “11-Projekt abgeschlossen” is completed in a project. Is this correct how I’m doing it? Because I got some issues, that it fires also when the task is not completed.
I don’t think the API provides for filtering down to the level you’re attempting. Two points specifically:
To my knowledge, you can’t filter for one specific task; you’ll get events for every task in the project being activated and you’ll need to filter out for that one task on your end.
You can’t filter for a specific value of a field, only for a field being changed. Meaning you’ll get events if tasks are marked incomplete as well as marked completed.
Also, I think I would use completed instead of completed_at for the field to monitor.
Would be great if we could have an option to get the data in the webhook. For eg. I need to watch the “change in name” of a project. For just this, I need to make another API call which harms the quota for the call in a bigger project