Is it possible to add a webhook filter for a change of section?
I’m trying to add webhooks to tasks that will fire also when the section is updated.
filters = [
{
“resource_type”: “task”,
“resource_subtype”: “default_task”,
“action”: “changed”,
“fields”: [
“completed”,
“due_on”,
“assignee”,
“section”
]
}
or
filters = [
{
“resource_type”: “task”,
“resource_subtype”: “default_task”,
“action”: “changed”,
“fields”: [
“completed”,
“due_on”,
“assignee”,
“memberships”
]
}
These don’t work.
Tips appreciated!
cc: @Ross_Grambo Another one of those webhook-filters questions…
I’m not actually sure. Have you tried memberships.section? If that doesn’t work I’ll ask an API eng.
I have tried, but it doesn’t work for me.
The
fields
field must be non-empty list of non-empty strings containing only letters and underscores.
I don’t know how the filters work internally, but it seemed to me adding ‘memberships’ to fields would call the webhook on all memberships changes.
An eng didn’t know the answer without digging in, but they has a great suggestion of creating a webhook on the project level, and watching what happens when you change a section.
I’m suspecting section changes only show up at the project level and not at the task level.
Okay it’s been a while but to follow up on this.
If you create a webhook targetting a project. i.e. resource = project_gid, and add NO filters, you will get section change events. They are resource_type = story
and resource_subtype=section_changed
This is why a filter where resource_type = ‘task’ does not see them.
I still don’t know what a story is, but at least now I can filter on them.
The payload below worked for me to receive section change events only.
{
"data": {
"resource": "<project_id>",
"target": "<webhook_url>",
"filters": [
{
"resource_type": "story",
"resource_subtype": "section_changed"
}
]
}
}