I created an integration for Asana and would like to get status updates for the tickets sent to asana. I already archived to create a webhook and get events through the webhook but it’s really confusing to find out what changed.
This is the response I get when creating a new task:
[
{
user: { gid: '1198854124070575', resource_type: 'user' },
created_at: '2022-07-05T15:38:56.766Z',
action: 'added',
parent: { gid: '1199596827596541', resource_type: 'project' },
resource: {
gid: '1202555016845892',
resource_type: 'task',
resource_subtype: 'default_task'
}
},
{
user: { gid: '1198854124070575', resource_type: 'user' },
created_at: '2022-07-05T15:38:57.173Z',
action: 'added',
resource: {
gid: '1202555016845892',
resource_type: 'task',
resource_subtype: 'default_task'
},
parent: { gid: '1199596827596547', resource_type: 'section' }
}
]
And this is the response when updating the status of a task:
[
{
user: { gid: '1198854124070575', resource_type: 'user' },
created_at: '2022-07-05T15:41:19.347Z',
action: 'added',
parent: { gid: '1199596827596546', resource_type: 'section' },
resource: {
gid: '1202555016845892',
resource_type: 'task',
resource_subtype: 'default_task'
}
},
{
user: { gid: '1198854124070575', resource_type: 'user' },
created_at: '2022-07-05T15:41:19.354Z',
action: 'removed',
resource: {
gid: '1202555016845892',
resource_type: 'task',
resource_subtype: 'default_task'
},
parent: { gid: '1199596827596547', resource_type: 'section' }
}
]
Seems really confusing to me because the action always is ‘added’ but I only want to notify the user once when the ticket is created in Asana and once when the status is changed.
Does someone have an idea how to archive that?
I also attached the filters I subscribed to when creating the webhook.
filters: [
{
action: 'added',
resource_type: 'task',
},
{
action: 'changed',
resource_type: 'task',
},
{
action: 'removed',
resource_type: 'task',
},
{
action: 'deleted',
resource_type: 'task',
},
],
Thanks for your help!