[Webhooks] Watching for tag changes to a task

I created a webhook to watch for changes on a task for the following fields:

  • due_on
  • completed
  • tags

due_on and completed triggers the webhook just fine while changes to tags do not.

I use the following payload when creating the webhook:

...
"filters": [
          {
            "action": "changed",
            "fields": ["due_on", "completed",  "tags"],
            "resource_type": "task"
          }
        ],
        "resource": "xxx",
        "target": "https://xxxx"
...

Hi @Ross_Grambo, are you able to check on this? Are tags changes not supported by webhook filtering?

(We still really need a definitive list in the documentation of what parameters work at what filter levels…)

This one would really be amazing.

I have tested this in different ways and it does seem that tags don’t get triggered at least watching for the “changed” action.

What would be the alternative to watch for tag changes in a task?

You would need to catch all changes to a task and store the returned tags in your own data store; then when you received another change for that task, compare its tags to the ones you stored to see if anything has changed.

How do I watch for any change in a task? Is that possible to do without having the fields filter?

In my current setup, I can watch for changes on the tags if someone touches the due_on or completed fields on a task, but if they only change the tag, it won’t trigger the webhook.

Just leave out the fields filter in your request and you’ll get all changes on that task.

1 Like

Wow! Didn’t know you can do this one. Thanks, will give it a try!

I have tried this and while it does watch for certain changes on the task, it does not trigger the webhook on a tag change (adding, removing). Was really hoping that was the fix I was looking for.

It’s totally possible that tags are not being listened to for changes, right? Do you think there’s still a way around this?

That’s very, very weird.

Are you setting the webhook at the task level, I guess? I’ve never used task-level webhooks, I only use project-level webhooks (and above), but I can say with 100.00% certainty that setting a project-level webhook will generate an event when a tag is added/modified on any task in that project.

Can you try setting a project-level webhook just to confirm that you then get the webhook events on tag changes? Because if you don’t, then something is up with your implementation; and if you do, then that would confirm an important finding about differences between project-level and task-level webhooks that would surprise me.

Thanks for your responses Phil, really appreciate your help. It’s a shame the Webhook section isn’t so well documented.

I have created a webhook at a project level and it’s still not working for me. What’s even worse is it doesn’t listen for any changes at all. There probably is something wrong with how I’m creating this webhook. I really just create a webhook that listens for changes on the project. This is the payload I send:

{
  "data": {
    "filters": [
      {
        "action": "changed",
        "resource_type": "project"
      }
    ],
    "resource": "<project_gid">,
    "target": "https://my.endpoint"
  }
}

What am I missing here?

Remove the filters section entirely.

Sorry for being late to this thread, but I agree with Phil. Try:

{
  "data": {
    "resource": "<project_gid">,
    "target": "https://my.endpoint"
  }
}

I got events of changing tags, but I created webhook with “added” filter on a project and when I add tags to a task or subtask I got events like this one, It looks like I added a task, but I didn’t, I just I added a tag to a task.
event:{
“user”: {
“gid”: “”,
“resource_type”: “user”
},
“action”: “added”,
“resource”: {
“gid”: “”,
“resource_type”: “task”,
“resource_subtype”: “default_task”
},
“parent”: {
“gid”: “”,
“resource_type”: “tag”
}
}
Hope this will help

Hi @Info7,

Yeah, that’s the way Asana events work. As the documentation says:

Note: The resource returned will be the resource that triggered the event.

In this case, the task is the resource that’s being monitored for changes, and when the API sees that a change occurred that you’re asking about - in your case adding a tag - that task triggers the event.