The webhook for deleting a task does not work

Hey!

I have successfully subscribed to events for a task:

  • creation
  • change
  • removal

Create / modify - works correctly

Deletion - either the POST request does not come at all. Either comes with the wrong GID

Tell me, what could be the error, and why the request behaves this way?

@Dima5 Hi, can you please provide me with details of your setup? Is it possible that you filter only for removal, not deletion (delete). Remove is the removal of a task of a project, if I’m correct.

Hi! I have the same issue.
can you tell if you solve this and how?

Thaks!

Hi @anon1141251,

Did you include both remove and delete in your filter? I think one of those should report on deletions but I can’t offhand recall which (you’d think it would be delete).

Hi!

I tried both, but neither works for me, in both cases the webhook is created and is active, but the notification when the task is deleted never arrives, and neither success nor fail appears in the webhook data.

This is the response of the api, maybe I am missing some required information?

“data”: {
“gid”: “1202400132966492”,
“active”: true,
“created_at”: “2022-06-06T17:53:10.301Z”,
“last_failure_at”: null,
“last_failure_content”: “”,
“last_success_at”: “2022-06-06T17:53:11.406Z”,
“resource”: {
“gid”: “1202400132695904”,
“name”: “96098 - Iredell Memorial Hospital - Box Truck Logos and Bottom Stripe”,
“resource_type”: “task”
},
“resource_type”: “webhook”,
“target”: “https://sandbox-platypus-sea-4714-180b4f35994.cs22.force.com/approval/services/apexrest/psprophet/pm/taskremoved?j=a0G1700000PBdlHEAT”,
“filters”: [
{
“resource_type”: “task”,
“resource_subtype”: “default_task”,
“action”: “deleted”,
“fields”: null
}
]
}

I tested this and did not get a removed or deleted event, either, when I deleted a task. Looks like a bug; I would recommend sending an email to api-support at asana dot com and reporting it!

For anyone encountering the same issue: the DELETED/UNDELETED action has to be set at a Project level.

It’ll trigger when any of its tasks is deleted. You can then get the task id from the resource object inside the incoming payload.

It can’t be set on a specific task.

Thanks! I can confirm that establishing a webhook where the resource is configured with a project GID you can receive and filter on all events.

  • changed: task was updated
  • added: task was added to the project
  • removed: task was removed from the project
  • deleted: task was deleted
  • undeleted: task was undeleted

It sounds logical, but in some cases a task is not added to any project. Is there a way to receive a task:deleted notification? I would like to track active webhooks in a cache and make some changes when a task has been deleted.

Hi @Füzi_András and welcome to the community!

Monitoring task events across an entire workspace isn’t supported, due to possible high-volume webhook traffic that can occur for considerably active workspaces.

For catching task deletions, good practice is to set up project-level webhooks for the projects you care about. This keeps event traffic manageable, while still giving you reliable delete notifications.

I understand, I see your point. But my question is: how can I track tasks if they haven’t been added to any project, since it’s not required for a task to belong to one? For example, I can create a task in my own task list without assigning it to any project.

If I’m right, there is no solution for this use case.

Your task list is known as your User Task List (UTL); it has a gid just like a project and you can set up a project webhook on it and receive events for it just like in a regular project.

(For tasks that are literally in no project and not assigned, you’re correct that you can’t get webhook events on those.)

Okay, got it. :slight_smile:
Thank you!