Understanding events received from Asana webhook

            "user": {
                "gid": "1200724370199303",
                "resource_type": "user"
            },
            "created_at": "2021-08-05T17:18:29.814Z",
            "action": "added",
            "resource": {
                "gid": "1200733354394388",
                "resource_type": "story",
                "resource_subtype": "added_to_project"
            },
            "parent": {
                "gid": "1200732153548458",
                "resource_type": "task",
                "resource_subtype": "default_task"
            }
        }

I am getting this as the event body from my webhook when creating a new task in a project.
I am not sure why the resource_type is ‘story’ and the parent is ‘task’.

From reading the documentation I was expecting the parent to be the subscribed project and the resource to be a task.

If any one could help me understand what I should be expecting or point me towards the proper documentation that would be greatly appreciated!

I have been looking here: Asana
but the expected event body parameters are only a few examples and don’t seem to align with the events being recieved.

Hi @Emily_Pasiak and welcome to the forum!

If you don’t filter out story webhooks, you’ll get them as you did here. Basically when you ask for webhooks for a project, you’ll get all webhooks unless you filter them out. In the case of adding a task, you’ll get multiple webhooks - you’ll get the one you were expecting (where the resource will be the task) and this one where a story is created for the task creation.

If you don’t want to get story webhooks, you can set a filter on your webhook. I set a filter like this:

{ resource_type = “task”, action = “added” };
{ resource_type = “task”, action = “changed” };
{ resource_type = “task”, action = “removed” };
{ resource_type = “section”, action = “added” };
{ resource_type = “section”, action = “changed” };
{ resource_type = “section”, action = “removed” };

which keeps me from getting story webhooks.

1 Like

This topic was automatically closed after 6 days. New replies are no longer allowed.