I have problem with events coming from Asana to my web hook. At the same request I get information about creating and removing event. When I later try to get information about what was the story about I get response Not a recognized ID. This event was sent right after moving task from one section to another. After such event the notifications get broken cause every next event looks like this, which causes my processing to stop. I must do some random operations(manually) on this task like ticking and unticking subtasks, moving from one section to another until a valid events come. Can you explain me why this happens? Iâm using Python with lib provided by you. Bellow I attach few logs
[DEBUG] 2018-11-22T11:58:33.493Z ef9ee3ce-ee4d-11e8-b11a-53fb3e131b01 Body: b'
{
"events": [
{
"resource": 920306355822303,
"user": 739769490757909,
"type": "story",
"action": "removed",
"created_at": "2018-11-22T11:58:24.325Z",
"parent": 920248604975478
},
{
"resource": 920306355822303,
"user": 739769490757909,
"type": "story",
"action": "added",
"created_at": "2018-11-22T11:58:24.413Z",
"parent": 920248604975478
}
]
}
'
[INFO] 2018-11-22T11:58:33.494Z ef9ee3ce-ee4d-11e8-b11a-53fb3e131b01 Webhook verification passed!
[ERROR] 2018-11-22T11:58:33.648Z ef9ee3ce-ee4d-11e8-b11a-53fb3e131b01 Exception: Not Found: story: Not a recognized ID: 920306355822303
And I want to mention that this error log was printed while checking the second event(addedd). I only check stories that are not removed
Your specific scenario isnât entirely clear from your description and the info posted. However, I can say itâs definitely the case that quite often (probably âalmost alwaysâ in my experience) in the process of a task-related action occurring in the Asana UI, that action produces multiple story events including quite often (or almost always) the creation and then almost-immediate deletion of stories.
My advice would be to assume youâll get webhooks on stories which have been deleted and write your code to ignore a story webhook on a story which Asana reports to no longer be valid - just assume itâs been deleted.
Is there a problem with doing that? Whatâs the larger picture of what youâre trying to accomplish? I would not try to use story webhooks as any type of reliable indicator of events occurring as stories only get created/sent in certain cases, not always.
In my case the taskâs subtasks ticking and moving task around sections events are quite important, I have simple state machine built using Asana. In my case when I get invalid event like for example moving task from one section to another(as presented in the topic), the action linked with moving this task canât be triggered, and than this task stays in void. Thatâs why I opened this topic, cause this situation happens quite often. And for moving tasks between sections and ticking subtasks as done I use API only, so this isnât related to Asana UI, in my case Asana UI is the âcureâ, cause thanks to it given task getâs repaired(proper events are getting sent)
I would just make two points:
-
We know that in the process of making changes to Asana, it generates some stories, letâs call them temporary stories, which are then immediately deleted. So your code is going to have to deal with those occurrences.
-
We also know that when changes are made in the Asana UI, sometimes stories and thus story events are generated, and sometimes they are not. See this post for more info on when they are not. Iâm not sure if the same thing holds true for changes made via the API but I would bet it does, and thus you should realize that you are likely not going to get story events for all changes that occur in Asana. For this reason, overall I consider stories as NOT a reliable data element to use in tracking Asana changes.
1 Like