We have an enhancement coming soon that could help with this!
While we always want to be clear that using stories for task changes is problematic (stories are designed for human consumption, and making multiple changes of the same kind at once can “collapse” them to reduce noise for human users of Asana) they will contain some of this information now (if you ask for it with opt_fields) and we’ll document it soon!
Here is the default payload returned from a story where I changed the description (the field on a task called “notes” in our API):
{
"user": {a user object and its fields}
"created_at": "2019-01-30T19:41:28.755Z",
"type": "story",
"action": "added",
"resource": {
"gid": "1107407559918819",
"id": 1107407559918819,
"resource_type": "story",
"created_at": "2019-01-30T19:41:28.592Z",
"created_by": {
"gid": "153678405088703",
"id": 153678405088703,
"resource_type": "user",
"name": "Matt Bramlage"
},
"type": "system",
"text": "added the description"
},
"parent": {a task object and its fields}
}
As you notice, you can’t tell what changed. However, you can ask for resource_subtype
with opt_fields
now - it will filter down to only the fields you request (as in all requests with opt_fields), but check out what this event looks like when I request resource_type and resource_subtype:
curl -v --request GET --header "Authorization: Bearer $ASANA_PERSONAL_ACCESS_TOKEN" "https://app.asana.com/api/1.0/projects/157953484489631/events?sync={a sync token}&opt_fields=resource.(resource_type|resource_subtype)"
{
"resource": {
"gid": "1107407559918819",
"id": 1107407559918819,
"resource_type": "story",
"resource_subtype": "notes_changed"
}
}
If you need to get the content of the notes afterwards, you still need to fetch the field; and if you need to know what they were before you still have to diff them against your own stored copy of what there was before, but at least you can see what I did to create the story now.
@Joe_Trollo is investigating ways we can bring this behavior to webhooks as well to enable something similar when we send out webhook events!