Unable to Retrieve the Latest Comment GID in Asana WebHook Story Comment Added Event

Hello,

I wanted to report an issue regarding the integration of the Asana WebHook Comment Added Event. It appears that the event payload is not updating with the latest Comment GID. Even when receiving new comments through the Comment Added Event, the Comment GID within the event remains stuck at the GID of the first comment. Consequently, this causes repeated comments to appear in my synchronization service.

e.g.

  1. register webhook:
    POST ASANA API /webhooks
    {
    “resource”: “XXX”,
    “target”: “webhookURL”,
    “filters”: [
    {
    “action”: “added”,
    “resource_type”: “task”,
    “resource_subtype”: “default_task”
    },
    {
    “action”: “changed”,
    “resource_type”: “task”,
    “resource_subtype”: “default_task”
    },
    {
    “action”: “removed”,
    “resource_type”: “task”,
    “resource_subtype”: “default_task”
    },
    {
    “action”: “deleted”,
    “resource_type”: “task”,
    “resource_subtype”: “default_task”
    },
    {
    “action”: “undeleted”,
    “resource_type”: “task”,
    “resource_subtype”: “default_task”
    },
    {
    “action”: “added”,
    “resource_type”: “story”,
    “resource_subtype”: “comment_added”
    }
    ]
    }
  2. added new stroy(commnet) to task
  3. receive event on my webhook server:
    {“events”:[{“user”:{“gid”:“user”,“resource_type”:“user”},“created_at”:“2024-01-05T06:39:57.384Z”,“action”:“added”,“parent”:{“gid”:“task”,“resource_type”:“task”,“resource_subtype”:“default_task”},“resource”:{“gid”:“123”,“resource_type”:“story”,“resource_subtype”:“comment_added”}}]}
  4. added another new stroy(commnet) to task
  5. receive event on my webhook server:
    {“events”:[{“user”:{“gid”:“user”,“resource_type”:“user”},“created_at”:“2024-01-05T06:39:57.384Z”,“action”:“added”,“parent”:{“gid”:“task”,“resource_type”:“task”,“resource_subtype”:“default_task”},“resource”:{“gid”:“123”,“resource_type”:“story”,“resource_subtype”:“comment_added”}}]}

still get story ID 123 in event…

I would greatly appreciate it if you could investigate this issue and provide a solution or workaround. Please let me know if any further information is required from my end to assist with the troubleshooting process.

Thank you for your attention to this matter.

Hi @HarryLi,

Welcome to our community forum and thank you for posting.

I tried to reproduce this issue using the Asana webhooks-nodejs sample app but could not reproduce your issue:

Steps:

  1. Establish a webhook with the following request body:
{
    "data": {
        "resource": "<PROJECT_GID>",
        "target": "<TARGET_URL>",
        "filters": [
            {
                "action": "added",
                "resource_type": "task",
                "resource_subtype": "default_task"
            },
            {
                "action": "changed",
                "resource_type": "task",
                "resource_subtype": "default_task"
            },
            {
                "action": "removed",
                "resource_type": "task",
                "resource_subtype": "default_task"
            },
            {
                "action": "deleted",
                "resource_type": "task",
                "resource_subtype": "default_task"
            },
            {
                "action": "undeleted",
                "resource_type": "task",
                "resource_subtype": "default_task"
            },
            {
                "action": "added",
                "resource_type": "story",
                "resource_subtype": "comment_added"
            }
        ]
    }
}
  1. Add a comment (story) on a task in <PROJECT_GID> in the Asana Web UI
  2. Saw the following response structure from my webhooks-nodejs server:
[
  {
    "user": {
      "gid": "123",
      "resource_type": "user"
    },
    "created_at": "2024-01-09T21:13:56.964Z",
    "action": "added",
    "resource": {
      "gid": "456",
      "resource_type": "story",
      "resource_subtype": "comment_added"
    },
    "parent": {
      "gid": "789",
      "resource_type": "task",
      "resource_subtype": "default_task"
    }
  }
]
  1. Added a comment (story) on the same task in <PROJECT_GID> in the Asana Web UI
  2. Saw the following response structure from my webhooks-nodejs server:
[
  {
    "user": {
      "gid": "123",
      "resource_type": "user"
    },
    "created_at": "2024-01-09T21:15:46.958Z",
    "action": "added",
    "resource": {
      "gid": "098",
      "resource_type": "story",
      "resource_subtype": "comment_added"
    },
    "parent": {
      "gid": "789",
      "resource_type": "task",
      "resource_subtype": "default_task"
    }
  }
]

As you can see from my experiment I was able to see two different events. I am not entirely sure why you are getting duplicate events. We haven’t seen any recent user reports of other users experiencing this issue. Perhaps there is some logic in your code that doesn’t replace the old event with the new event?

Let us know if you are still experiencing this issue. Perhaps you might want to try cloning our webhooks-nodejs server and trying your experiment again to see if you run into the same issue.

1 Like