Webhooks and Status Update

Hi!

I wanna know if i can make that certain comment and due date of a task transform into a status update and due date for the project. It its possible to achieve this via webhooks?

Thanks!

Yep!

Someone asked something similar to this a few days ago:

You’ve asked specifically about doing it with a webhook. So that would mean, instead of retrieving the comments via the endpoint I mentioned in that other thread, you would set a webhook on the project(s) you want to do this in (you’ll need a separate webhook for each project), and monitor the data sent from that webhook for story added events. When you receive a new story you want to add as a status update, add it via the endpoint I mentioned in the other thread.

Please follow up if you have any questions about the above info.

Great, thank you!

Hi again!

I tried to create a webhook that do what i prevously mention, but
i did not succeed:

-Send new comments in a certain task.
-Send the due date of certain task.

Can you help me?

Thanks

This is an example of my webhook for the comments, its this right?:

{
“data”: {
“filters”: [
{
“resource_type”: “story”,
“resource_subtype”: “comment_added”,
“action”: “added”
}
],
“resource”: “1191096445245138”, ----> PROJECT ID
“target”: “https://dfe484a0-94d7-4762-a24c-bac643887b1b.trayapp.io
}
}

Please tell us specifically what happened or didn’t happen that you were expecting. If you got an error back, tell us the details of it.

Thanks for the quick answer.

Once that i have established the webhook, i receive data like the following, but no text of the comments. There is any filters or fields that i need to add to the webhook?

"method": “post”,
** “path”: “/”,**
** “body”: {**
** “events”: [**
** {**
** “user”: {**
** “gid”: “595274115733732”,**
** “resource_type”: “user”**
** },**
** “created_at”: “2020-09-24T14:07:49.398Z”,**
** “action”: “added”,**
** “resource”: {**
** “gid”: “1195609638927622”,**
** “resource_type”: “story”,**
** “resource_subtype”: “comment_added”**
** },**
** “parent”: {**
** “gid”: “1191784326921361”,**
** “resource_type”: “task”,**
** “resource_subtype”: “default_task”**
** }**
** }**
** ]**
** },**

Correct! Webhooks only tell you what has changed; you’ll need to do additional API call(s) to retrieve the actual content of those resource(s).

From the API documentation:

Note that events are “skinny” and contain only some basic details of the change, not the whole resource. We expect integrations to make additional calls to the API to retrieve the latest state from Asana.

Ok, i didnt know that. Thanks i gonna try adding API Calls.

1 Like