Listening (webhook) for new comments on a project status update

Hi Phil, thanks for your response.

I subscribe to a each project without a filter right now.
await asanaClient.webhooks
.createWebhook({
target: ‘https://9306c88cc67e.ngrok.io/asana-webhook’,
resource: a.gid ← which is for example 1171144249301681 (a project gid)
})

after that I receive via webhook:

{
“events”: [
{
“user”: {
“gid”: “60604372481597”,
“resource_type”: “user”
},
“created_at”: “2020-11-26T20:14:38.692Z”,
“action”: “added”,
“resource”: {
“gid”: “1198849159775633”,
“resource_type”: “story”,
“resource_subtype”: “comment_added”
},
“parent”: {
“gid”: “1171144249301681”,
“resource_type”: “project”
}
}
]
}

I check for

event.action === ‘added’ &&
event.parent?.gid &&
event.resource?.resource_type === ‘story’ &&
event.resource?.resource_subtype === ‘comment_added’

before getting the story (event.resource.gid), if the story.target?.resource_type === ‘project’ holds true, I’m fetching the last project update:

const statusUpdates = await asanaClient.projectStatuses.getProjectStatusesForProject(
										story.target.gid,
										{ limit: 1 }
									);

which then gives me the gid I need to receive the latest status update:

const statusUpdate = await asanaClient.projectStatuses.getProjectStatus(
statusUpdates.data[0].gid
);

feels like a super hacky workaround though :stuck_out_tongue:

Too bad that there is no option to watch for comments, is this somehow planned? It would be a super cool use case to make a bot that does some action on specific comments.